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 do you mean by command line argument?
Write a program to implement queue.
What is the purpose of macro in C language?
What is modeling?
What are bitwise shift operators in c programming?
Give the rules for variable declaration?
Describe the header file and its usage in c programming?
How many levels of pointers have?
what is a constant pointer in C
When should a type cast be used?
What is the size of a union variable?
What does %p mean?
Tell me when is a void pointer used?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
differentiate built-in functions and user – defined functions.