fork download
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5. int n, i, sh = 0; // I still don't for what sh is used ...
  6. int v[100];
  7.  
  8. printf ("Please write n:");
  9. scanf("%d",&n);
  10.  
  11. // Get the values
  12. for ( i=0; i < n; i++ )
  13. {
  14. printf( "\n Write the element %d", i );
  15. scanf( "%d", &v[i] );
  16. }
  17.  
  18. printf( "\n" );
  19.  
  20. // Print the values multiple of 5
  21. for ( i=0; i < n; i++ )
  22. {
  23. if ( v[i] % 5 == 0 )
  24. printf( "V[%d]=%d\n", i, v[i] );
  25. }
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 2252KB
stdin
4
10
9
20
14
stdout
Please write n:
 Write the element 0
 Write the element 1
 Write the element 2
 Write the element 3
V[0]=10
V[2]=20