Answers for "program in c to find number is even or odd"

C
1

c program to tell whether a number is an integer is even or odd

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

}
Posted by: Guest on April-19-2021
1

odd even in c

#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;
}
Posted by: Guest on August-17-2021

Code answers related to "program in c to find number is even or odd"

Code answers related to "C"

Browse Popular Code Answers by Language