0

How to write a function that takes user input(a number) and show its sum with 10,and then call the function?

function with user input

27th Feb 2017, 2:43 PM
mohammad mazhariroshan
mohammad mazhariroshan - avatar
3 odpowiedzi
+ 4
void function(int input) { int added = input + 10; cout << input << " + 10 = " << added << ends; } int main() { int inputNumber; cout << "Enter a number to add with 10: "; cin >> inputNumber; function(inputNumber); return 0; } Is this what you wanted?
27th Feb 2017, 4:11 PM
Zeke Williams
Zeke Williams - avatar
0
wow I can only handle the problem with Java or JavaScript ...do u mind?
27th Feb 2017, 2:45 PM
Decodeworms Olamilekan
Decodeworms Olamilekan - avatar
0
sry I wanna see it in c++. i'm not good with java yet ...
27th Feb 2017, 3:02 PM
mohammad mazhariroshan
mohammad mazhariroshan - avatar