In this tutorial learn how you can write a c program to test a number entered by user whether it is divisible exactly by 5 but not by 11.
If the remainder is 0 then it is divisible. So we use this logic with if statement.
C programming is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, etc.
Here is the code to test a number entered by user whether it is divisible exactly by 5 but not by 11 in C programming.
#include <stdio.h> //WAP to test a number entered by user whether it is divisible exactly by 5 but not by 11.
int main(){
int num;
printf("Please enter the number:");
scanf("%d",&num);
if(num%5==0 && num%11!=0)
printf("%d is divisible exactly by 5 but not by 11.",num);
else printf("%d isnot divisible exactly by 5 but not by 11.",num);
return 0;
}
This is how you can test a number entered by user whether it is divisible exactly by 5 but not by 11 in c programming. Comment below if you like our tutorial.