Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2. int main (){
  3.  
  4. int pomal_broj = 37;
  5. int pogolem_broj = 1357;
  6. int pozicija = 1;
  7. int nov_broj = 0;
  8.             while (pogolem_broj>0){
  9.     if (pozicija%2!=0){
  10.         nov_broj= nov_broj *10 + (pogolem_broj %10);
  11.     }
  12. pozicija++;
  13. pogolem_broj/=10;
  14.  }
  15.  int prevrten_broj = 0;
  16.  while (nov_broj>10){
  17.      prevrten_broj = prevrten_broj *10 + (nov_broj %10);
  18.      nov_broj/=10;
  19.  }
  20.  if (pomal_broj == prevrten_broj)
  21.     printf("DA");
  22.     else
  23.         printf("NE");
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement