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.

C Program to Find Largest of Three Numbers Using Function

Algorithm -:

  1. Program Start
  2. Variable Declaration (int a,b,c,l)
  3. Input number from the user
  4. Calling Function to find Largest Numbers among Three number
  5. Check the condition
  6. Display answer according the condition
  7. 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

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.

Jeetu Sahu is A Web Developer | Computer Engineer | Passionate about Coding, Competitive Programming, and Blogging

Leave a Comment