write a program to accept a number and check whether it is divisible by 5 or not in c++
Answers
Answered by
1
C++is not available in phones
emmalee:
ok not c++ c
Answered by
2
#include<stdio.h>
void main()
{
int i;
printf("Enter a number:");
scanf("%d",&i);
if(i%5 == 0)
{
printf("Entered number is divisible by 5");
}
else
{
printf("Entered number is not divisible by 5");
}
getch();
}
Hope this helps!
void main()
{
int i;
printf("Enter a number:");
scanf("%d",&i);
if(i%5 == 0)
{
printf("Entered number is divisible by 5");
}
else
{
printf("Entered number is not divisible by 5");
}
getch();
}
Hope this helps!
Similar questions