Answer:
#include<stdio.h>
//declare a named constant
#define MAX 50
int main()
{
//declare the array
int a[MAX],i;
//for loop to access the elements from user
for(i=0;i<MAX;i++)
{
printf("\n Enter a number to a[%d]",i+1);
scanf("%d",&a[i]);
}
//display the input elements
printf("\n The array elements are :");
for(i=0;i<=MAX;i++)
printf(" %d ",a[i]);
}
Explanation:
PSEUDOCODE INPUTARRAY(A[MAX])
REPEAT FOR I EQUALS TO 1 TO MAX
PRINT “Enter a number to A[I]”
READ A[I]
[END OF LOOP]
REPEAT FOR I EQUALS TO 1 TO MAX
PRINT A[I]
[END OF LOOP]
RETURN
ALGORITHM
ALGORITHM PRINTARRAY(A[MAX])
REPEAT FOR I<=1 TO MAX
PRINT “Enter a number”
INPUT A[I]
[END OF LOOP]
REPEAT FOR I<=1 TO MAX
PRINT A[I]
[END OF LOOP]