- Flowchart :
- Syntax :
datatype array_name[size];
- Program :
#include<stdio.h>
#include<conio.h>
void main()
{
int arr[5], i;
clrscr();
printf("\n----------------1D ARRAY----------------");
for(i = 0; i < 5; i++)
{
printf("Enter a[%d]: ", i);
scanf("%d", &arr[i]);
}
printf("\nPrinting elements of the array: \n\n");
for(i = 0; i < 5; i++)
{
printf("%d ", arr[i]);
}
getch();
}
- Output :
No comments:
Post a Comment