Advertisement
STANAANDREY

pc4

Oct 5th, 2022 (edited)
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.   int n;
  5.  
  6.   while (1) {
  7.     printf("n="); scanf("%d", &n);
  8.     if (!n) {
  9.       break;
  10.     } else if (n > 0) {
  11.       if (n % 2) {
  12.     puts("impar");
  13.       } else {
  14.     puts("par");
  15.       }
  16.     } else  {
  17.     puts("eroare: n tre sa fie >0");
  18.     }
  19.   }
  20.  
  21.   return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement