Solved programming problem

How to scan and print 1D array in C

Source code

#include<stdio.h>

int main()

{

    int array[100];/// declare a 1D Array.

    int i,n;

    printf("
Please Enter The array size:");

    scanf("%d",&n);

    printf("
Please Enter %d Element Of the array: 
",n);

    for(i=0; i<n; i++) ///scan array element

    {

        scanf("%d",&array[i]);

    }

    printf("
Array: ");

    for(i=0; i<n; i++) ///print array element

    {

        printf("
%d",array[i]);

    }

      printf("
");

    return 0;

}

Output

Please Enter The array size:5

Please Enter 5 Element Of the array:

1 34 53 4 6

Array:

1

34

53

4

6

Join the discussion

Add your comment

2 previous comments

fFLcqb

<a href=https://viagr.mom>does extenze work like viagra</a> I still remember seeing Raul Ibanez and his young son exiting the Phillies clubhouse a few years ago

Dusclulse

Combination Birth Control And Amoxicillin [url=https://newfasttadalafil.com/]cialis from usa pharmacy[/url] Xkmzmj <a href=https://newfasttadalafil.com/>cialis price</a> Amoxicillin By Vbulletin Intitle View Profile The first step in investigation of a solitary pulmonary nodule is to obtain a previous CXR for comparison. Jcvlkm https://newfasttadalafil.com/ - generic cialis medicare pays for cialis