Write a C Program to Test a Number Entered by User Whether it is Divisible Exactly by 5 but not by 11

July 11, 2022 0 Comments

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.


write c program to test number entered by user whether it is divisible exactly by 5 but not by 11



Write a Program to Test a Number Entered by User Whether it is Divisible Exactly by 5 but not by 11

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;
}

Test Live At Jdoodle



Conclusion

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.

Leave a comment

Gallery