Give a method to count the number of ones in a 32 bit number?
Answer Posted / ataraxic
int i = 0;
while (x) {
x &= x-1;
++i;
};
printf("number of ones is %d\n", i);
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What is far pointer in c?
What is a buffer in c?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
What are pointers? What are different types of pointers?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
What does the characters “r” and “w” mean when writing programs that will make use of files?
i have a written test for microland please give me test pattern
How the c program is executed?
Without Computer networks, Computers will be half the use. Comment.
Should I learn data structures in c or python?
How a string is stored in c?
What is extern keyword in c?
What are the different data types in C?