// Online C compiler to run C program online
#include <stdio.h>
int main() {
int n;
printf("Enter the number: ");
scanf("%d", &n);
if(n % 6 == 0 && n % 5 == 0){
printf("%d is divisible by both", n);
}
else if(n%6==0){
printf("%d is only divisible by 6", n);
}
else if(n%5==0){
printf("%d is only divisible by 5", n);
}
else {
printf("%d is not divisible by both", n);
}
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter