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

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

C program to check whether a number is divisible by 5 and 11; In this tutorial, we will learn how to check whether a number is divisible by 5 and 11 in c program with the help of if-else statement and conditional operators.

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

  • Algorithm of to Check the Number is Divisible by 5 and 11
  • C Program to Check the Number is Divisible by 5 and 11 using If Else Statement
  • C Program to Check the Number is Divisible by 5 and 11 using Conditional Operator

Algorithm of Check the Number is Divisible by 5 and 11

Use the algorithm to write a c program to check the number is divisible by 5 and 11; as follows:

  • Step 1: Start.
  • Step 2: Read a number from the user.
  • Step 3: Check the a number is divisible by 5 and 11 using if else or conditional operators
  • Step 4: Print result.
  • Step 6:End.

C Program to Check the Number is Divisible by 5 and 11 using If Else Statement

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

The output of the above c program; as follows:

Please Enter any Number to Check whether it is Divisible by 5 and 11 : 55
Given number 55 is Divisible by 5 and 11

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

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

The output of the above c program; as follows:

Please Enter any Number to Check whether it is Divisible by 5 and 11 : 55
Given number 55 is Divisible by 5 and 11

Recommended C Programs

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published.