Advertisement
adventuretimeh

precedente e successivo

Oct 17th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5. // precedente e succesivo//
  6. int main(int argc, char *argv[]) {
  7.     int a;
  8.     int prec, succ;
  9.     printf ("immetti il numero:");
  10.     scanf ("%d",&a);
  11.     prec = a - 1 ;
  12.     succ = a + 1 ;
  13.     printf ("\n");
  14.     printf ("il numero inserito e' %d\n'", a);
  15.     printf ("il numero precedente a %d e' %d\n", a, prec);
  16.     printf ("il numero successivo a %d e' %d\n", a, succ);
  17.    
  18.     exit(0);
  19.    
  20.    
  21.    
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement