One dimensional Array
One dimensional array syntax
datatype variablename arraylenth;
Ex:-
int a[];
int a[10],b[10];
#include<stdio.h>
main()
{
int a[5],i;
clrscr();
for(i=0;i<5;i++)
{
printf("\nEnter the elements for a[%d]:",i);
scanf("%d",&a[i]);
}
printf("original order is....\n");
for(i=0;i<5;i++)
printf("\n the element in index a[%d]=%d",i,a[i]);
getch();
}
0 comments:
Post a Comment