Advertisement
lineoff

ex4

Jan 11th, 2016
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. //
  2. //  main.c
  3. //  inverser
  4. //
  5. //  Created by MacBook Pro on 11/01/2016.
  6. //  Copyright © 2016 MacBook Pro. All rights reserved.
  7. //
  8.  
  9. #include <stdio.h>
  10. #include "stdlib.h"
  11.  
  12. int main(int argc, const char * argv[]) {
  13.     int n,ni;
  14.     printf("Donner un nombre:\n-> ");
  15.     scanf("%d",&n);
  16.     ni = 0;
  17.     while (n != 0) {
  18.         ni = ni*10 + n %10;
  19.         n /=10;
  20.     }
  21.     printf("-> %d\n",ni);
  22.     system(pause);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement