Wednesday, November 9, 2011

Write a program that read and display an array.

#include<stdio.h>
#include<conio.h>
void main()
{
   int i,n,a[100];
   clrscr();
   printf("How many numbers: ");
   scanf("%d",&n);
   for (i=0; i<n; i++)
   scanf("%d",&a[i]);
   for (i=0; i<n; i++)
   printf("%4d",a[i]);
   getch();
}

From: Book by ashraf

No comments:

Post a Comment

Comment of this content!