+ 1

Can anyone tell me the mistake in this c++ program? It says something about the boolean and the & operator

In c++ trying to make a program to pass a new course but it says an error #include <iostream> using namespace std; int main() { bool mathematics ; bool language ; if((mathematics = 0) || (language = 0) ){ cout<<"pass";} else if( (mathematics = 0) & & (language = 0) ){ cout << "failed"; } return 0; }

2nd Jul 2017, 12:48 PM
silvia mena
silvia mena - avatar
4 Answers
+ 3
here's the corrected version I made some changes. https://code.sololearn.com/c7OJzud1QHlS/?ref=app
2nd Jul 2017, 1:24 PM
‎ ‏‏‎Anonymous Guy
+ 4
1.You didn't assign any value to the variables 2.You wrote & & instead of && 3.You wrote = (asignment) instead of ==
2nd Jul 2017, 12:58 PM
Andrés04_ve
Andrés04_ve - avatar
+ 1
The answer's Sreejith is a good correction! 🙂
28th Aug 2017, 12:05 PM
Ismael Rufian Rodriguez
Ismael Rufian Rodriguez - avatar
0
thank you very much 😊
2nd Jul 2017, 1:41 PM
silvia mena
silvia mena - avatar