adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

program in c to show the given numbers in array using pointer

Program in C to show the given numbers in array using pointer


#include<conio.h>
#include<stdio.h>
 void main()
  {
       int *ptr,arr[30],i,n;
       ptr=arr; //ptr=&arr[0];
       printf("Enter the number of integer to be entered :-");
       scanf("%d",&n);
       printf("Enter %d numbers:-",n);
       for(i=0;i<n;i++)
       scanf("%d",&arr[i]);
       printf("Entered numbers is :-");
       for(i=0;i<n;i++,*ptr++)
       printf("%4d",*ptr);
    getch();
  }
Output:-







Post a Comment

0 Comments