Advertisement
Guest User

Auditoriska 5 z5 so while

a guest
Dec 9th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int from,to;
  6. int obratenbroj;
  7. int cifra;
  8. scanf("%d %d", &from, &to);
  9. int broj;
  10. int temp;
  11. broj=from;
  12. while(broj<to){
  13. //for(broj=from;broj<to;broj++){
  14. obratenbroj=0;
  15. temp=broj;
  16. while(temp>0){
  17. cifra=temp%10;
  18. obratenbroj=obratenbroj*10+cifra;
  19. temp=temp/10;
  20.  
  21. }
  22. if(broj==obratenbroj){
  23. printf("%d\n", broj);
  24. }
  25. broj++;
  26. }
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement