Saturday, 19 September 2020

Program to check whether the number is divisible by 5 or not.





/*Program to check whether the number is divisible by 5 or not.*/
#include<stdio.h>
int main()
{
int num;
printf("Enter the number you want to check: ");
scanf("%d",&num);
if(num%5==0)
{
    printf("%d is divisible by 5",num);
}
else
{
         printf("%d is not divisible by 5",num);
}
return 0;
}

OUTPUT:


DESCRIPTION:
In this program we asked the user to input a number then we divide it by 5.If the remainder is 0 it display the number is divisible else yhe number is not divisible.

VARIABLES USED
num:-this variable is used to store the number given by the user.

Watch also the python tutorial .




No comments:

Post a Comment

If you have any doubt, please ask in the comment section.

Search This Blog

Program to print weather the number is happy or not.

#include <stdio.h> #include <math.h> int main () { int i , j , num , temp , sum = 0 ; printf ( "Enter number\n...