Write a program to check whether a given number is even or odd using the modulus operator.
#include <stdio.h> int main() { int num; // Take input from the user printf(“Enter a number: “); scanf(“%d”, &num); // Check if the number is even or odd using modulus operator if (num % 2 == 0) { printf(“%d is even.\n”, num); } else { printf(“%d is odd.\n”, num); } return 0; } Explanation: The … Read more