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.

Algorithm and Programs to Check the Number is Divisible by 5 and 11 OR Not

  • Algorithm 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 whether a number is divisible by 5 and 11 or not; 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

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including 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. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *