Accept Array elements

#include<stdio.h>
void main() {
int arr[10], i, j, k, size;
printf("\nEnter array size : ");
scanf("%d", &size);

printf("\nAccept Numbers : \n");
for (i = 0; i < size; i++)
{
printf("Data [%d]: ",i+1);
scanf("%d", &arr[i]);
}

printf("\nThe Array is : ");
for (i = 0; i < size; i++)
printf("%d ", arr[i]);

getch();
}

   

Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C