Answer Posted / vadivel t
#include<stdio.h>
int main()
{
int no, bit;
printf("ENTER THE NO AND BIT NO, TO TOGGLE: ");
scanf("%d %d", &
no, &bit);
if(no & (0x1 << bit-1))
{
no = no^(0x1 << bit - 1);
}
else
{
no = no | (0x1 << bit - 1);
}
printf("%d \n", no);
_getch();
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
How many identifiers are there in c?
What does s c mean in text?
Explain how do you generate random numbers in c?
Describe explain how arrays can be passed to a user defined function
What is the use of typedef in c?
When should a type cast be used?
What is union in c?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What is oops c?
What is difference between structure and union in c programming?
What would be an example of a structure analogous to structure c?
What is the difference between exit() and _exit() function?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
Explain how can you tell whether two strings are the same?