C. Write a program to find whether entered number by the user is a multiple of 4 or not.
Answers
Answered by
1
Answer:
#include <stdio.h>
int main() {
int num;
printf("Enter an integer: ");
scanf("%d", &num);
// True if num is perfectly divisible by 4
if(num % 4 == 0)
printf("%d is divisible by 4.", num);
else
printf("%d is not divisible by 4.", num);
return 0;
}
Output
Enter an integer: 7
7 is not divisible by 4
Similar questions