Write a program to enter 50 numbers and check whether they are divisible by 5 or not. If
divisible then perform the following tasks.
1) Display all the numbers ending with the digit 5
2) Count those numbers ending with 0(zero)
Answers
Answered by
1
Explanation:
#include<stdio.h>
int main()
{
int arr[50], total_zeros=0;
for (int i=0;i<50;i++)
scanf("%d", &arr[i]);
for (int i=0;i<50;i++)
{
if (arr[i]%5==0)
{
if (arr[i]%10==0)total_zeros++;
else printf("%d\n", arr[i]);
}
}
return 0;
}
Hope this will help you.
Similar questions