#include <stdio.h>
void accept();
int greatest();
int main()
{
int a,b,c;
void accept(){
printf("\nEnter three integer numbers: \n");
printf("\nEnter the first number: ");
scanf("%d",&a);
printf("\nEnter the second number: ");
scanf("%d",&b);
printf("\nEnter the third number: ");
scanf("%d",&c);
}
int greatest(){
if((a >= b) && (a >= c))
return a;
else if ((b >= a) && (b >= c))
return b;
else
return c;
}
accept();
printf("The greatest number is: %d", greatest());
return 0;
}
Comments
Leave a comment