Write a C Program to Check the Number is Divisible by 5 and 11 with an example using If Else Statement, and the Conditional Operator.

## C Program to Check the Number is Divisible by 5 and 11 Example

This program helps the user to enter any number. Next, this program checks whether the number is divisible by both 5 and 11 using If Else.

/* C Program to Check the Number is Divisible by 5 and 11 */ #include<stdio.h> int main() { int number; printf("\n Please Enter any Number to Check whether it is Divisible by 5 and 11 : "); scanf("%d", &number); if (( number % 5 == 0 ) && ( number % 11 == 0 )) printf("\n Given number %d is Divisible by 5 and 11", number); else printf("\n Given number %d is Not Divisible by 5 and 11", number); return 0; }

**OUTPUT**

## Program to Check the Number is Divisible by 5 and 11 using Conditional Operator

This program will use the Conditional Operator to check whether it is divisible by both 5 and 11 in C.

/* C Program to Check the Number is Divisible by 5 and 11 Using Conditional Operator */ #include<stdio.h> int main() { int number; printf("\n Please Enter any Number to Check whether it is Divisible by 5 and 11 : "); scanf("%d",&number); ((number % 5 == 0 ) && ( number % 11 == 0 )) ? printf("\n Given number %d is Divisible by 5 and 11", number) : printf("\n Given number %d is Not Divisible by 5 and 11", number); return 0; }

**OUTPUT**

Let me try another value