Advertisement
adventuretimeh

NUMERO PARI DISPARI

Nov 4th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 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 numero;
  8.     int resto;
  9.     printf("dammi un numero");
  10.     scanf("%d",&numero);
  11.     resto=numero%2
  12.     if(resto=0)
  13.     {
  14.     printf("numero e pari");
  15.     }
  16.     else
  17.     printf("numero e dispari");
  18.     }
  19.     return 0;
  20. }
  21. // error:
  22.  
  23. //D:\Users\adv.exe\Desktop\main.c   In function 'main':
  24. //12    5   D:\Users\Adv.exe\Desktop\main.c [Error] expected ';' before 'if'
  25. //C:\Users\Adv.exe\Desktop\main.c   At top level:
  26. //19    2   D:\Users\Adv.exe\Desktop\main.c [Error] expected identifier or '(' before 'return'
  27. // 20   1   D:\Users\adv.exe\Desktop\main.c [Error] expected identifier or '(' before '}' token
  28. // 28       D:\Users\adventuretimeh.exe\Desktop\Makefile.win    recipe for target 'main.o' failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement