[Solved] Ask user to enter an integer value for each element of the array [closed]


One advice, if you don’t learn for yourself, then nobody can teach you. So, please try researching a bit on the internet, or reading a good book before you post a question.

Assuming this is your first mistake, and you wont repeat this without working a little on your own, i’ll provide the code and the explanation..

#include<stdio.h>

int main(void)
{
    int arr[5], i;

    printf("please enter the numbers one by one");
    for(i = 0; i < 5; i++)
    {
         scanf("%d", &arr[i]);
    }

    printf("The numbers you entered are\n");
    for(i = 0; i < 5; i++)
    {
         printf("%d ", arr[i]);
    }
}

solved Ask user to enter an integer value for each element of the array [closed]