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
Explain what are preprocessor directives?
What is use of integral promotions in c?
Why does this code crash?
What is getch c?
What is default value of global variable in c?
What is meant by int main ()?
What is c method?
How do you redirect a standard stream?
What is ctrl c called?
What is wild pointer in c with example?
What is header file definition?
Which one would you prefer - a macro or a function?
What is function definition in c?
Is c pass by value or reference?
What is difference between structure and union?