write a program to find out number of on bits in a number?

Answer Posted / sriharsha

main()
{
int n;
printf("\n Enter The Number Whose bits have to find");
scanf("%d",&n);
i=i*8;
printf("\n The number of bits in the given number is %d",i);
}

Is This Answer Correct ?    2 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If fflush wont work, what can I use to flush input?

618


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4182


How can a program be made to print the name of a source file where an error occurs?

734


Explain argument and its types.

608


What is the ANSI C Standard?

782






Can we compile a program without main() function?

637


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

659


Explain how do you determine a file’s attributes?

596


Why do we use c for the speed of light?

609


What is function and its example?

630


How will you delete a node in DLL?

688


What is the use of getchar() function?

632


What is the use of the function in c?

602


What is the advantage of an array over individual variables?

746


What is quick sort in c?

588