C Program to get input of array and output it
I am creating a 15 integer array which is input from the user and outputted for the.
Ex.
Enter the array values: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Your values are: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Code:
#include <stdio.h>
/* function main begins program execution */
int main()
{
int value[15];
while(true)
{
printf( "Enter the array values: " ); //prompt
scanf( "%d", &value); //reads integers
printf("Your values are: ");
for(int i=0; i<15; i++)
{
printf("%d", value[i]);
}
}
return 0;
}
|