Advertisement
adventuretimeh

prec e succ con operatore unario

Dec 8th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 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.  
  6. int main(int argc, char *argv[]) {
  7. int num,succ,prec;
  8. printf("dammi un numero");
  9. scanf("%d",&num);
  10. succ=++num;
  11. printf("successivo vale %d",succ);
  12. --num;
  13. prec=--num;
  14. printf("il precedente vale %d",prec);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement