//to write consice programs we use conditional operator in place of if else, // #include<iostream> #include<string> using std::string; using std::cout; using std::cin; using std::endl; int main() { string name="vishal"; string guess; cout<<"Guess the name"<<endl; cin>>guess; /* int points=guess==name ? 10:0; //this will check if guess is same as name, if yes then it will store value 10 in var points and will store zero if guess is not equal to name. */ // guess==name ? cout<<"guess is correct "<<endl : cout<<"guess is wrong "<<endl; //if guess is correct it will execute the first cout, if not it wil execute the second one. }