Write program to display all value of array using pointer

Posted on Updated on

C program to search an element in an array using pointers

#include<stdio.h>
#include<conio.h>
void max(int *p)
{
int i=0;
while(i<5)
{
printf(“%5d”,*p);
p++;
i++;
}
}
void main()
{
clrscr();
int ar[]={10,20,30,40,50};
max(ar);

}

This program solved by Ms. Aakriti Srivastav (Presented by Jitendra Kumar JAVA Trainer at Vtech Academy of Computers)- C | C++ | DS | JAVA | Android | Python & Oracle

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s