Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Write a program in C++ that can be used to read in two integers values through the keyboard, pass them as parameter to a function named sum() and computes their total and returns their result which is then output appropriately.
Posted
Updated 13-Aug-10 21:25pm
v2
Comments
Emilio Garavaglia 14-Aug-10 3:46am    
Reason for my vote of 1
homework
Sandeep Mewara 14-Aug-10 3:53am    
Reason for my vote of 1
1. No Effort
2. Homework

CodeProject doesn't do homework. But if we did, it would probably be the best homework in the world.
 
Share this answer
 
It does not work like this here.

Here is what is expected by enquirers:
1. TRY first what you want to do!
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.
 
Share this answer
 
MIDL
#include<iostream>
Int sum(int,inti);
Int main()
{
Int x,y,add;
X=20;
Y=50;
Add=sum(x,y);
Cout"The sum is:"<<add<<endl;
Return 0;
}
Int sum(intx,inty);
{
Intz;
Z=x+y;
Return y;
}
 
Share this answer
 
Comments
Niklas L 14-Aug-10 8:12am    
C++ is case sensitive. Int is not the same as int. Looks like you used Microsoft Word as editor.

What exactly is your question here? Specify a question, and you are likely to get an answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900