Posts

Showing posts from February, 2021

c program to clear nth bit of the number || Bitwise Operators || Problem Solving ||

#include <stdio.h> int main() {     int num, n, newNum;     printf("Enter any number: ");     scanf("%d", &num);     printf("Enter nth bit to clear (0-31): ");     scanf("%d", &n);     newNum = num & (~(1 << n));     printf("Number before clearing %d bit: %d (in decimal)\n", n, num);     printf("Number after clearing %d bit: %d (in decimal)\n", n, newNum);     return 0; } Logic :-  num&(~(1<<n));
           ðŸŒžVocabulary🌞 1. WANE (VERB): (क्षीण होना):  decrease Synonyms: decline, diminish Antonyms: increase Example Sentence: About half-past eight the combat began to wane. 2. DEPLOY (VERB): (तैनात करना):  position Synonyms: station, post Antonyms: concentrate Example Sentence: Forces were deployed at strategic locations. 3. DISASTROUS (ADJECTIVE): (विनाशकारी):  bcatastrophic Synonyms: calamitous, cataclysmic Antonyms: fortunate Example Sentence: A disastrous fire swept through the museum. 4. OVERLOOK (VERB): (अनदेखी करना):  disregard Synonyms: neglect, ignore Antonyms: punish Example Sentence: She was more than ready to overlook his faults. 5. HUMANITARIAN (ADJECTIVE): (मानवतावादी):  compassionate Synonyms: humane, unselfish Antonyms: selfish Example Sentence: She has been recognized as a great humanitarian for her efforts to end hunger. 6. TORMENT (NOUN): (व्यथा):  agony Synonyms: suffering, torture Antonyms: pleasure Example Sentence: Their deaths have left both families in to