Advertisement
Guest User

od binaren vo dekaden

a guest
Nov 27th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int broj,pom1,pom2;
  5.     int niza[100],i=0,j;
  6.     scanf("%d",&broj);
  7.     pom2=broj;
  8.  
  9.     while(pom2!=0){
  10.         niza[i++]=pom2%2;
  11.         pom2=pom2/2;
  12.     }
  13.  
  14.     for(j=i-1;j>0;j--){
  15.         printf("%d",niza[j]);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement