Write a C Program using function to check whether the given input is divisible by 5 or not.
Source Code in C:
#include<stdio.h>
void divis (int p, int q);
int main()
{
int a, b=5;
scanf("%d", &a);
divis(a, b);
}
void divis (int p, int q)
{
if (p%q = =0)
printf ("\n Given number is divisible by 5");
else
printf ("\n Given number is not divisible by 5");
}
Source Code in C:
#include<stdio.h>
void divis (int p, int q);
int main()
{
int a, b=5;
scanf("%d", &a);
divis(a, b);
}
void divis (int p, int q)
{
if (p%q = =0)
printf ("\n Given number is divisible by 5");
else
printf ("\n Given number is not divisible by 5");
}
int main()
{
int digit;
printf("\nEnter your digit: ");
scanf("%d", &digit);
strng(digit);
}