C language

Write a function to find how many binary 1s nd 0s present in a number

Questions by yekkalarajesh

Showing Answers 1 - 2 of 2 Answers

vasi7999

  • Jun 3rd, 2012
 

The c program is as follows :

Code
  1. #include<stdio.h>

  2. #include<conio.h>

  3. "

  4. Enter the number of digits in the given number : ");

  5. scanf("%d""

  6. Enter the Binary number one by one: ""%d""

  7. The Number of Zeros is : %d""

  8. The Number of Ones is : %d",o);

  9.  

  10. getch();

  11.  

  12. }

  Was this answer useful?  Yes

Arupananda Pradhan

  • Aug 13th, 2012
 

Code
  1. #include<stdio.h>

  2. "enter a number");

  3.     scanf("%d"// end of loop"The number of 1 in %d is %d"//main function end<pre>
    Code
    1. #include<stdio.h></span><span style="color: #ff0000">"enter a number"</span><span style="color: #009900">)</span><span style="color: #339933"></span></div></li>

    2. <li style="background: #fcfcfc"><div style="font-family: 'Courier New', Courier, monospace font-weight: normal font-style: normal">    scanf<span style="color: #009900">(</span><span style="color: #ff0000">"%d"</span><span style="font-style: italic">// end of loop</span><span style="color: #ff0000">"The number of 1 in %d is %d"</span><span style="font-style: italic">//main function end</span></div></li></ol></div></pre>


Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions