write a program to input a number and check whether it is even or odd​

Question

write a program to input a number and check whether it is even or odd​

in progress 0
Raelynn 2 weeks 2021-09-09T06:11:11+00:00 2 Answers 0 views 0

Answers ( )

    0
    2021-09-09T06:12:21+00:00

    #include <stdio.h>

    int main() {

    int num;

    printf(“Enter an integer: “);

    scanf(“%d”, &num);

    // True if num is perfectly divisible by 2

    if(num % 2 == 0)

    printf(“%d is even.”, num);

    else

    printf(“%d is odd.”, num);

    return 0;

    }

    Output

    Enter an integer: -7

    -7 is odd.

    #coder pro

    0
    2021-09-09T06:12:29+00:00

    Answer:

    hi

    Step-by-step explanation:

    Program to Check Even or Odd

    #include <stdio.h>

    int main() {

    int num;

    printf(“Enter an integer: “);

    scanf(“%d”, &num);

    // True if num is perfectly divisible by 2

    if(num % 2 == 0)

    printf(“%d is even.”, num);

    else

    printf(“%d is odd.”, num);

    return 0;

    }

    Output

    Enter an integer: -7

    -7 is odd.

Leave an answer

Browse
Browse

18:9+8+9*3-7:3-1*13 = ? ( )