Write a C program to Create an Array of input and output.

Function Main
    Declare Integer Array values[5]
    Declare Integer i
    
    Output "Enter 5 integers: "
    For i = 0 to 4
        Input values[i]
    End
    Output "Show the Array values: "
    For i = 0 to 4
        Output values[i]
    End
End

#include <stdio.h>
int main() {
//! showArray(values)

int values[5];

  printf("Enter 5 integers:\n ");

 for(int i = 0; i<=4; ++i) {
     scanf("%d\n", &values[i]);
  }

  printf("Show the Array values:\n ");
  for(int i = 0; i<=4; ++i) {
     printf("%d\n", values[i]);
  }
  return 0;
} 
Enter 5 integers: 
1
2
3
4
5
Show the Array values: 
1
2
3
4
5

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.