C - A4P1 - C program to enter the value in an array and print the value.





Write a C program to enter the value in an array of size 10 and print the value.

#include<stdio.h>
#include<conio.h>
void main()
{
    int arr[5],i;
    clrscr();
    printf(":: Enter Array Elements ::\n\n");
    for(i=0;i<5;i++)
    {
        printf("Enter Element [%d] -> ",i);
        scanf("%d",&arr[i]);
    }
    printf("\n\n::: Array Elements :::\n");
    for(i=0;i<5;i++)
    {
        printf("\nElement [%d] :: %d",i,arr[i]);
    }
    getch();
}

Post a Comment