how to TOGGLE Nth bit of variable in a MACRO

Answer Posted / kiran kumar yakkala

#define ~toggle(val,n) var^=1<<n


Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a dynamic array in c?

589


What is wrong in this statement?

601


Why c language is called c?

567


Discuss the function of conditional operator, size of operator and comma operator with examples.

676


How many data structures are there in c?

612






write a program to print largest number of each row of a 2D array

1867


What is realloc in c?

581


Write a program to swap two numbers without using third variable?

813


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

665


What is a nested formula?

599


Explain what is a 'locale'?

581


What is array of pointers to string?

564


What are the application of void data type in c?

697


How do you define a function?

579


What is the use of a ‘’ character?

582