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
Tell us the use of fflush() function in c language?
how to execute a program using if else condition and the output should enter number and the number is odd only...
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
Can we replace the struct function in tree syntax with a union?
What is the difference between formatted&unformatted i/o functions?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
List some of the dynamic data structures in C?
What does the function toupper() do?
What is calloc() function?
How do you generate random numbers in C?
Explain what is the purpose of "extern" keyword in a function declaration?
Sir i need notes for structure,functions,pointers in c language can you help me please
How many bytes is a struct in c?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?