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; }
3 Réponses
+ 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
+ 1
it's correct ma dear
+ 1
Tnx. U much😉