google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to implement array using pointers in c - 2nd puc computer science

Write a program to implement array using pointers in c

Write a program to implement array using pointers in c

#include<stdio.h>

#include<conio.h>

void main()

{

int a[10], i, n;

clrscr();

printf("How many elements? ");

scanf("%d",&n);

printf("Enter the elements:\n");

for(i=0;i<n;i++)

scanf("%d",(a+i));

printf("The entered elements are\n");

for(i=0;i<n;i++)

printf("%d\n",*(a+i));

getch();

}

Output:

How many elements? 3

Enter the elements:                                                            

1                                                                              

2                                                                              

3                                                                               

The entered elements are                                                       

1                                                                              

2                                                                               

Write a program to implement array using pointers in c Write a program to implement array using pointers in c Reviewed by Vision Academy on December 14, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.