Slideshow

Monday, 25 February 2013



Q.71 Write a program to find the highest of three numbers using pointer to function. 6)

Ans:
A C program to find the highest of three numbers using pointer to function is listed
below:
#include<conio.h>
void main()
{
int x,y,z;
clrscr();
printf("\n Enter three numbers : ");
scanf("%d %d %d",&x,&y,&z);
printf("\n\n The highest of the three numbers is : ");
highest(&x,&y,&z);
getch();
}
highest(a,b,c)
int *a,*b,*c;
{
if(*a > *b && *a > *c)
printf("%d",*a);
else if(*b > *a && *b > *c)
printf("%d",*b);
else
printf("%

No comments:

Post a Comment