Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Friday, February 11, 2011

C17 : Enter n numbers into an Array and print it

Back to Home   &  C


//Program to enter n numbers into an array and print it

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a[10],i,n;
printf("Enter limit value\n");
scanf("%d",&n);
printf("Enter array elements\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("Array elements are...\n");
for(i=0;i<n;i++)
{
printf("%d\n",a[i]);
}
getch();
}
-----------------------------------------------------------------
Output
Enter limit value
2
Enter array elements
16
76
Array elements are...

16
76
===============================================
Back to Home   &  C

No comments: