#include<stdio.h>
#include<conio.h>
main(){
float i,j,k,ans;
float greatest(float a,float b,float c);
clrscr();
printf("Enter values of i,j,k\n");
scanf("%f%f%f",&i,&j,&k);
ans=greatest(i,j,k);
printf("%f is greatest\n",ans);
getch();
return 1;
}
float greatest(float a,float b,float c){
if(a>b){
if(a>c) return a;
else return c;
}
else{
if(b>c) return b;
else return c;
}
}
No comments:
Post a Comment