Thursday, September 22, 2016

Arrays in C- Creation,Input and Print

#include<stdio.h>
#include<conio.h>
int main()
{
    int a[5];
    int i;
printf("enter the number of elements");
    for(i=4;i>=0;i--)
    {
    scanf("%d",&a[i]);
    //printf("\n%d",a[i]);
}
printf("the elements are");
    for(i=0;i<5;i++)
    {
  
    printf("\n%d",a[i]);
}
    getch();
}

No comments:

Post a Comment