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();
}

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart