program not returning to choice(after enter the wrong number)

program not returning to choice(after enter the wrong number)


#include<iostream.h>
#include<stdlib.h>
#include<time.h>


main()
{
int beginner, intermediate, advance, number, choice;
number=1;
cout<<" enter 1 for beginner level 1 "<<endl;

cout<<" enter 2 for intermediate level 1 "<<endl;

cout<<" enter 3 for advance level 1 "<<endl;


cout<<"choice"<<endl;
cin>>choice;


if(choice==1)
{
cout<<"beginner level in the range [1 - 20]:";
cin>>beginner;
}
if(number<11)
{
cout<<"your number is correct";

}
if(number>11)
{
cout<<"your number is wrong";
}



if(choice==2)
{
cout<<"intermediate level in the range [1 - 50]:";
cin>>intermediate;
if(number<30)
{
cout<<"your number is correct";

}
if(number>30)
{
cout<<"your number is wrong";
}

}


if(choice==3)
{
cout<<"advance level in the range [1 - 100]:";
cin>>advance;
if(number<90)
{
cout<<"your number is correct";

}
if(number>90)
{
cout<<"your number is wrong";
}

}


else if (3<choice)
{
cout<<"you entered the wrong number...";
}

return (choice);

}
Topic archived. No new replies allowed.