"}" isn't recognized????! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

"}" isn't recognized????!

I was doing some exercises but i came across a strange thing! My code : #include <iostream> using namespace std; int main() { int y; int x=0; for(x; x=0&&x<10; x++;) { cout<<"Put any value other than 5!"<<endl; cin>>y; if(y==5) { x=11; cout<<"Hey!, you weren't supposed to type 5!"<<endl; } if(x==9&&y!=5) { cout<<"Wow, you're more patient then I am, you win."<<endl; } } return 0; } The last } can't be recognised so intmain() isn't "closed" but why!?

13th Jul 2017, 10:45 AM
Θεόδωρος Ιωάννου
Θεόδωρος Ιωάννου - avatar
5 Answers
+ 1
yup @ace got it right
13th Jul 2017, 11:07 AM
Nirmal Kumar Bhakat
Nirmal Kumar Bhakat - avatar
+ 1
oh really?? Thanks guys ! I will test it just to confirn it!
13th Jul 2017, 11:08 AM
Θεόδωρος Ιωάννου
Θεόδωρος Ιωάννου - avatar
+ 1
Yep confirmed!
13th Jul 2017, 11:09 AM
Θεόδωρος Ιωάννου
Θεόδωρος Ιωάννου - avatar
+ 1
Have a nice day Happy coding
13th Jul 2017, 11:14 AM
Nirmal Kumar Bhakat
Nirmal Kumar Bhakat - avatar
0
Happy coding to you too!
13th Jul 2017, 11:14 AM
Θεόδωρος Ιωάννου
Θεόδωρος Ιωάννου - avatar