Advertisement
CotaIgnorada

ejercicio progra

Oct 8th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include<stdio.h>;
  2.    int main(){
  3.        int x=18326521;
  4.        int y=0;
  5.        int z=0;
  6.        int j=0;
  7.        for (y=1; y<=32;y++){ // valor inicial; condicion; incremento
  8.             z=(x & (1<<y));
  9.             if(z!=0){
  10.                 j++;
  11.                 printf("La cantidad de ceros es %d\n", j);
  12.             }
  13.         }
  14.         return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement