# C programming Doubt

Given an integer M perform the following conditional actions:

• If M is multiple of 3 and 5 then print “Good Number” (without quotes).

• If M is only multiple of 3 and not of 5 then print “Bad Number” (without quotes).

• If M is only multiple of 5 and not of 3 then print “Poor Number” (without quotes).

• If M doesn’t satisfy any of the above conditions then print “-1” (without quotes).

a) #include<stdio.h>
int main() {
int n;
scanf("%d",&n);
if(n%3==0 && n%5==0){
printf(“Good Number”);
}
else if(n%3==0 && n%5!=0){
printf(“Bad Number”);
}
else if(n%5==0 && n%3!=0){
printf(“Poor Number”);
}
else{
printf("-1")
}
return 0;
}

#include<stdio.h>
int main(){
int x ;
scanf("%d" , &x );
if(x%3==0 && x%5==0){
printf(“good number”);
} else if(x%3==0 && x%5!=0){
printf(“bad number”);
}else if(x%3!=0 && x%5 ==0 ){
printf(“poor number”);
}else{
printf("-1");
}
return 0 ;
}

#include<stdio.h>
int main() {
int n;
scanf("%d",&n);
if(n%3==0 && n%5==0){
printf(“Good Number”);
}
else if(n%3==0 && n%5!=0){
printf(“Bad Number”);
}
else if(n%5==0 && n%3!=0){
printf(“Poor Number”);
}
else{
printf("-1")
}
return 0;
}