C Program to Find Largest of Three Numbers Using Function
In this article, we are going to write a c program to find the Largest of Three Numbers Using Function
To find gretest of three numbers using function, first you need to know about the function. You can read about the function from the link given below.
Now without wasting time let’s start programming.
Algorithm -:
- Program Start
- Variable Declaration (int a,b,c,l)
- Input number from the user
- 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
Read More
- Download C Language Notes Pdf
- C Language Tutorial For Beginners
- C Programming Examples With Output
- 250+ C Programs for Practice PDF Free Download
Conclusion
So friends In this article, we have make a c program to find Largest of Three Numbers Using Function
If you have difficulty to understanding any program or have any doubts or questions, then tell me in the comment below.