Thursday 1 October 2015

c programe to count no of set bit in an integer

#anki 



#include<stdio.h>

void main()
{
 int i,count=0;
 printf("enter the value");
 scanf("%d",&i);
 while(i)
 {
   if((i & 1)==1) count++;
  i=i>>1;
   }

   printf("count =%d",count);
   getch();   
}

One Response so far.

  1. Blog27999 says:

    As reported by Stanford Medical, It is really the one and ONLY reason this country's women get to live 10 years longer and weigh an average of 42 lbs lighter than us.

    (And realistically, it really has NOTHING to do with genetics or some secret diet and absolutely EVERYTHING to do with "HOW" they eat.)

    P.S, I said "HOW", not "WHAT"...

    CLICK this link to determine if this easy test can help you discover your real weight loss possibility

Leave a Reply

 
 

Labels