#include <iostream>
using namespace std;
int main ()
{
int a,b,c;
cout<<"Introdu un numar,mai putin 5";
cin>>a;
{
if (a!=5)
cout<<"Introdu un numar,mai putin 5";
cin>>b;
}
else
cout<<"Bai raule!Ti-am zis sa nu pui 5!";
{
if (b!=5)
cout<<"Introdu orice numar,mai putin 5";
cin>>c;
}
else
cout<<"Bai raule!Ti-am spus sa nu pui 5!";
{
if (c!=5)
cout<<"Esti tare!N ai pus 5 deloc!";
}
else
cout<<"Bai de ce ai pus 5??";
return 0;
}
#include <iostream>
usingnamespace std;
int main ()
{
int a,b,c;
cout<<"Introdu un numar,mai putin 5";
cin>>a;
if (a!=5)
{
cout<<"Introdu un numar,mai putin 5";
cin>>b;
}
else
{
cout<<"Bai raule!Ti-am zis sa nu pui 5!";
}
if (b!=5)
{
cout<<"Introdu orice numar,mai putin 5";
cin>>c;
}
else
{
cout<<"Bai raule!Ti-am spus sa nu pui 5!";
}
if (c!=5)
{
cout<<"Esti tare!N ai pus 5 deloc!";
}
else
{
cout<<"Bai de ce ai pus 5??";
}
return 0;
}
Move the open curly brace to after line 9.
{
if (a!=5)
cout<<"Introdu un numar,mai putin 5";
cin>>b;
Basically it is a good thing to use curly brackets whenever you use