C program to Create an Array and Print it Elements
Write a C program to Create an Array and Print it Elements:
Required Knowledge:
C basics, ArraysProgram:
1 #include<stdio.h>
2
3 void main()
4 {
5 int array[5];
6
7 int i;
8
9 for(i=0; i<=4; i++)
10 {
11 printf("Enter the number %d:",i+1);
12 scanf("%d",&array[i]);
13 }
14
15 printf("The numbers you entered are:\n");
16
17 for(i=0; i<=4; i++)
18
19 {
20 printf("%d\n",array[i]);
21 }
22
23 }
Output:
Enjoy it........
Comments
Post a Comment
Dears! Yours Comment approved in 24 hours also your answer in 24 hours.......