Categories




C program to find largest number using function / function in C

C program to find the largest number using function/function in C 
Note: If you are beginner in programming then I recommended you to visit the following topics, which make you easy to understand this programming easily.

*  String Function
*  Array and Type’s
*  Switch Case
*  Function


Algorithm
 

 

11.      START

 

22.      Read numbers

 

33.      g=greater(a,b);h=greater(g,c);i=greater(h,d);

 

44.       j=greater (i,e); k=greater(j,f);

 

55.      Display “Largest number is k”
66.      END
 int greater (int x, int y )
77.          if (x>y) return x;  else return y;
Flowchart
 
Flow Chat
So without delay lets go to  program ;
 
C Program To Find Largest Using Function:
 
 
 


 #include<stdio.h>  
#include<conio.h> 
int greater (int, int );
int main ()
{
    int a,b,c,d,e,f,g, h, i, j, k;
printf ("Enter six numbers");
scanf ("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);
    g=greater(a,b);
    h=greater(g,c);
i=greater(h,d);
    j=greater (i,e);
    k=greater(j,f);
printf ("The largest number is %d", k);
getch ();
    return 0;
}
int greater (int x, int y )
{
    if (x>y)
    return x;
    else 
    return y;
}

OUTPUT:

So this is your simple programming to solve ” Program to find greatest among given number using function” . If you have any problem of miss understanding in program then you can visit my social media and message me or simply comment below.

SIMILAR POST
 
Loading...

admin

Leave a Reply

Your email address will not be published. Required fields are marked *