Friday, 5 July 2013

Program to Print elements of linear array.



//Header Files
#include<stdio.h>
#include<conio.h>
int arr[10],n,j;
void main()
{
clrscr();
printf("Enter size of array:");
scanf("%d", &n);
printf("\n Enter array elements....");
for(int i=0;i<=n-1;i++)
    scanf("%d",&arr[i]);
printf("\n Printing of Elements...");
j=0;

while(j<=n-1)
{
    printf("\n");
    printf("%d", arr[j]);
    j=j+1;
}

getch();
}

No comments:

Post a Comment