jituTechnology

jituTechnology

A program to find the largest of three number using function.

A program to find the largest of three number using function.

Codes
/*A program to find the largest of three number using function*/
/*Programed by          Jitendra Kr Yadav
                        10116
                        22 Mar,2011*/
#include<stdio.h>
#include<conio.h>
int larger(int,int,int);
main()
{
int a, b, c;
printf(“Enter the first number:”);
scanf(“%d”,&a);
printf(“Enter the second number:”);
scanf(“%d”,&b);
printf(“Enter the third number:”);
scanf(“%d”,&c);
larger(a,b,c);
getch();
}
int larger(int x,int y,int z)
{
if(x>y)
{
if(x>z)
printf(“The largest number among them is %d.\n\n”,x);
else
printf(“The largest number among them is %d.\n\n”,z);
}
else
{
if(y>z)
printf(“The largest number among them is %d.\n\n”,y);
else
printf(“The largest number among them is %d.\n\n”,z);
}
printf(“Press any key to continue…”);
}
Output
Enter the first number: 5
Enter the second number: 2
Enter the third number: 4
The largest number among them is 5.
Press any key to continue…
Add a comment

Comments (1)

  1. Roxanne BoettcherApril 4, 2012 Reply
    Thank you for this article. I will also like to say that it can possibly be hard when you are in school and simply starting out to create a long credit ranking. There are many students who are simply trying to make it through and have a long or positive credit history is often a difficult element to have.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930