Advertisement
semsem_elazazy

Untitled

Dec 28th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.    int n;
  6.    char c;
  7.    do
  8.    {
  9.        printf("Enter a number:");
  10.        scanf("%d",&n);
  11.    
  12.    if(n%2==0)
  13.    {
  14.        printf("Your number is even\n");
  15.    }
  16.    else
  17.    {
  18.       printf("Your number is odd\n");
  19.    }
  20.    printf("Want to check more? Enter any key to continue or ā€˜n’ to exit:");
  21.    scanf("\n%c", &c);
  22.    }
  23.    while(c!='n');
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement