Answer Posted / banavathvishnu
#include<stdio.h>
#include<conio.h>
Togglebit(int k,int bit)
{
printf("after %d bit is toggled = %d",bit,(k^(1<<(bit-
1))));
return 1;
}
int main()
{
int i;
int bitno;
printf("enter the number \n");
scanf("%d",&i);
printf("enter the bit number to toggle \n");
scanf("%d",&bitno);
Togglebit(i,bitno);
getch();
return 1;
}
Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What are linker error?
Why do we use & in c?
Tell me what is the purpose of 'register' keyword in c language?
How does normalization of huge pointer works?
What is the use of bitwise operator?
What is the difference between char array and char pointer?
What is the difference between text and binary i/o?
What are the 3 types of structures?
Is c procedural or object oriented?
Explain what is output redirection?
What is memory leak in c?
What are the different types of pointers used in c language?
What is a shell structure examples?
What language is lisp written in?
What is a union?