C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » Mathematics ProgramRSS Feeds

Program to find largest integer among the three and display it using function with return type

Posted By: Easy Tutor     Category: C++ Programming     Views: 54759

A C++ Program that find the largest integer out of three integers provided and display the largest integer(using functions with return type).

Code for Program to find largest integer among the three and display it using function with return type in C++ Programming


 int largest(int,int,int);


       int value_1;
       int value_2;
       int value_3;
       int maximum;

       cout<<"\n Enter the value_1 =  ";

       cout<<"\n Enter the value_2 =  ";

       cout<<"\n Enter the value_3 =  ";


       cout<<"\n The largest integer is = "<<maximum<<endl;

       return 0;

 /*************************************************************************///-------------------------  largest(int,int,int)  ----------------------///*************************************************************************/int largest(int x,int y,int z)
       int largest=x;



       return largest;

Easy Tutor
Easy Tutor author of Program to find largest integer among the three and display it using function with return type is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Happy Programming :)

View All Articles

Related Articles and Code:

Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

Craig Smith from United States Comment on: Jun 25
I'm getting my butt kicked with this stuff! Please help me along. Try not to help TOO TOO much; I want to learn this without being given the answers. May be tough because I'm so lost! My assignment is to make a function that returns largest of three numbers passed to it. So far I have for different tries and they either give me back, "None", "*** 'return' outside function", or "unexpected indent". Here's the part that's good, now what? (I'm on a PC)

[#function is called largestNum
import math
def maxOfThree(a,b,c):
max = a

#enter three numbers

a = input ('give me a number')
b = input ('give me another number')
c = input ('give me a another number')
print (a,b,c)]

View All Comments