Write a program to enter any 50 numbers and check whether they are divisible by 5 or not .if divisible then perform the following tasks:a)display all the numbers ending with the digit 5 b)count those numbers ending with 0
Answers
Answered by
1
Answer:
#include<stdio.h>
int main()
{
int i=0,n,count=0;
while(i<50)
{
scanf("%d",&n);
if(n%5==0)
{
if(n%10==0)
{
count++;
}
else
{
printf("%d ",n);
}
}
i++;
}
printf("\n%d",count);
return 0;
}
Explanation:
Above C program satisfies your requirement.
Similar questions