0

can u make me simple a sample of this program?? plz. Need help

#include <iostream> using namespace std; int sum(int a,int b=20) { int result; result= a + b; return(result) } int main() { int a=100; int b=200; int result; result= sum(a, b); cout<<"Total value is:"<<result<<endl; result= sum(a); cout<<"Total value is:"<<result<<endl; return 0; }

12th Dec 2016, 7:38 AM
09754166750
09754166750 - avatar
3 ответов
+ 1
#include <iostream> using namespace std; int sum(int a,int b=20) { return(a+b); } int main() { cout<<"Total value is:"<<sum(100, 200)<<endl; cout<<"Total value is:"<<sum(100)<<endl; return 0; } I Hope that'll work
12th Dec 2016, 9:28 AM
Vipul Walia
Vipul Walia - avatar
+ 1
it's correct ma dear
12th Dec 2016, 10:24 AM
Alfred Sey
Alfred Sey - avatar
+ 1
Tnx. U much😉
12th Dec 2016, 3:25 PM
09754166750
09754166750 - avatar