Program to Input 5 numbers in array using pointer

#include<stdio.h>
#include<conio.h>
void main()
{
  clrscr();
  int x[5],*p,i;
     for(i=0;i<5;i++)
     {
      printf("\n enter no");
      scanf("%d",&x[i]);
     }
      p=&x[0];
      for(i=0;i<5;i++)
     {
      printf("\n %d:",*p);
      p++;
     }
  getch();
}

Leave a Reply