Calling Function to find Largest Numbers among Three number
Check the condition
Display answer according the condition
Program End
Program To Find Largest of Three Numbers Using Function
//C program to find the Largest of three numbers Using Function
#include<stdio.h>
int larg(int, int, int);
int main()
{
// Variable declaration
int a,b,c, l;
printf("Enter Three Number\n");
scanf("%d %d %d",&a,&b,&c);
//calling function to find Largest number
l = larg(a,b,c);
//Display Largest number
printf("Largest Number is : %d",l);
return 0;
}
int larg(int a, int b, int c)
{ int larg;
// Larg among a, b and c
if(a>b)
{
if(a>c)
larg = a;
else
larg = c;
}
else
{
if(b>c)
larg = b;
else
larg = c;
}
}
Output -:
Enter Three Numbers
10
19
13
Largest Number is : 19
Algorithm -:
Program To Find Largest of Three Numbers Using Function
Output -:
need an explanation for this answer? contact us directly to get an explanation for this answer