My issue
It is showing wrong answer though there is no error in my code and I am getting desirable output.
My code
#include <stdio.h>
int main(void) {
int a = 15;
int b = 35;
if (a % 5 == 0 && a % 7 == 0) {
printf("The number %d is divisible by both 5 & 7\n", a);
} else {
printf("The number %d is not divisible by both 5 & 7\n", a);
}
if (b % 5 == 0 && b % 7 == 0) {
printf("The number %d is divisible by both 5 & 7\n", b);
} else {
printf("The number %d is not divisible by both 5 & 7\n", b);
}
return 0;
}
Learning course: CSEIPFOIA: Programming and Problem Solving
Problem Link: And Statement Practice Problem in CSEIPFOIA: Programming and Problem Solving - CodeChef