#include<stdio.h>
#include<conio.h>
void main()
{
int i, limit, no[97];
clrscr();
printf("How many numbers you want to enter? ");
scanf("%d", &limit);
printf("\nEnter %d numbers one by one\n", limit);
for(i=0; i<limit; i++)
{
printf("Enter number %d: ", i+1);
scanf("%d", &no[i]);
}
printf("\nYou have entered following numbers\n");
for(i=0; i<limit; i++)
{
printf("\nNumber %d is %d", i+1, no[i]);
}
getch();
}
/*
How many numbers you want to enter? 7
Enter 7 numbers one by one
Enter number 1: 23
Enter number 2: 43
Enter number 3: 56
Enter number 4: 78
Enter number 5: 97
Enter number 6: 52
Enter number 7: 5
You have entered following numbers
Number 1 is 23
Number 2 is 43
Number 3 is 56
Number 4 is 78
Number 5 is 97
Number 6 is 52
Number 7 is 5
*/
No comments:
Post a Comment