Guest User

Untitled

a guest
Nov 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main () {
  4.  
  5. int n[ 10 ]; /* n is an array of 10 integers */
  6. int i,j;
  7.  
  8. /* initialize elements of array n to 0 */
  9. for ( i = 0; i < 10; i++ ) {
  10. n[ i ] = i + 100; /* set element at location i to i + 100 */
  11. }
  12.  
  13. /* output each array element's value */
  14. for (j = 0; j < 10; j++ ) {
  15. printf("Element[%d] = %d\n", j, n[j] );
  16. }
  17.  
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment