C Programming

C program to check the entered number is exactly divisible by 5 but not 11

Write a program that checks whether the number entered by the user is exactly divisible by 5 but not by 11. 

C Code

#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{

int number;

printf("enter number:");
scanf("%d", &number);

if(number%5==0 && number%11!=0)
printf("%d is divisible by 5 but not by 11", number);
else
printf("condition is not satisfied");

getch();
}

Output

divisible by 5 but not 11
divisible by 5 but not 11

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.