Answer Posted / sanyam jain
#include<stdio.h>
int main()
{
int a,b;
printf("Enter the number to be flipped\n");
scanf("%d",&a);
printf("Enter which bit to be flipped: ");
scanf("%d",&b);
a = a^(1<<(b-1));
printf("Resultan number is %d\n",a);
}
Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
Create a simple code fragment that will swap the values of two variables num1 and num2.
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
What is the difference between declaring a variable and defining a variable?
In which language linux is written?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
What are the benefits of organizational structure?
Explain what is a pragma?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is array within structure?
Explain how can I manipulate strings of multibyte characters?
What is the use of bitwise operator?
What does typedef struct mean?
Is javascript written in c?
What is difference between Structure and Unions?
What is modifier & how many types of modifiers available in c?