Write c program where the user takes an array with n elements and finds the elements whose value is a multiple of the number 5.These elements are displays on screen along with their value like this : V[i]=a ,V[j] = b,.... My code :
#include <stdio.h>
int main ()
{
int n,i,sh=0;
int v[100];
printf ("Please write n:");
scanf("%d",&n);
for (i=0;i<n;i++)
{ printf ("\n Write the element %d",i);
scanf("%d",&v[i]);
}
if (v[i] %5)
printf("The element is a multiple of 5",&sh);
return 0;
}
It compiles perfectly,but when I run this and I write the elements,it does nothing..where am I wrong?
EDIT :
Yes,here it is :
Please write n: 4
Enter value 0: 10
Enter value 1 : 9
Enter value 2 : 20
Enter value 3:14
V[0]=10,V[2}=20