SIMULATION FOR EVEN/ODD NUMBER USING C

QUIZ

  •   Choose the appropriate option which indicates the even condition.
  • i%3==0
    i%2==0
    i%2!=0
    None of the above
  •   How many choices are possible when using a single if-else statement?
  • 1
    2
    3
    4
  •   int b= -30;
      int a=b % 4;
      What will be the value of int a ?
  • 0
    7
    -2
    2

    Simulator

    Code

    #include<stdio.h>
       int main()
       {
            int num;
            printf("Enter an integer: ");
            scanf("%d", &num);
         if(num % 2 == 0)
            printf("%d is even.", num);
         else
            printf("%d is odd.", num);
         return 0;
        }