An array is structure.It holds many number in same datatypes.we need to fixed its size first.
Array have two types
1. One dimensional array.
2. Two dimensional array.
Source code:
- #include<stdio.h>
- #include<conio.h>
- int main()
- {
- //Variable Declaration.
- int a[100],i,n;
- //Take input of max number of array.
- printf("give the number:");
- scanf("%d",&n);
- //Take input in array.
- printf("enter 1 d array digit:\n");
- for(i=0;i<n;i++)
- scanf("%d",&a[i]);
- //Give output in array.
- printf("output will be:");
- for(i=0;i<n;i++)
- printf("%d\t",a[i]);
- return 0;
- }
Output:
Give the number:5
Enter 1 d array digit:
1 2 3 4 5
Output will be:1 2 3 4 5
ohhh well done bro
ReplyDeleteThanks.
DeleteThanks....
ReplyDelete