i cannot under stand this error in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

i cannot under stand this error in c++

error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'int')| this is what is wrote => { cout << " The INFINITE 4X MULTIPLIER\n\n\n\n\n\n\n"; int a; int b; int c; int d; int sum1; //sum1 = a*b*c*d; int sum2; //sum2 = a*b*c; cout<<"HOW TO USE IT:-\n\n"; cout<<"1.blablabla<<endl; cin>>a; cin>>b; cin>>c; cin>>d; if(sum1=0){cout<<"product is =\n"<<sum2=a*b*c;} else{cout<<sum1=a*b*c*d;} } according to compiler error is in last line

17th Sep 2016, 10:12 AM
Som Harsh
Som Harsh - avatar
2 Answers
+ 1
You forgot a double quote in cout<<"1.blablabla<<endl;
17th Sep 2016, 1:37 PM
Zen
Zen - avatar
0
in if you can't cout<<"product is =\n"<<sum2=a*b*c; because you can't assign value in cout ;) also not in else
17th Sep 2016, 12:44 PM
Amir Hossein Farzin
Amir Hossein Farzin - avatar