I just started learning c++, and I've encountered a problem.
I'm attempting to make it so that if I input my name, the program will say that I'm cool, but if any other name is typed it will say that they are uncool. However, even when I type in my name the program says that I am uncool. So, I was just wondering if anyone could tell me how to fix this problem. Thanks in advance.
I'm attempting to make it so that if I input my name, the program will say that I'm cool, but if any other name is typed it will say that they are uncool. However, even when I type in my name the program says that I am uncool. So, I was just wondering if anyone could tell me how to fix this problem. Thanks in advance.
Code:
#include <iostream>
using namespace std;
int main()
{
int name;
cout<<"Welcome to the name-judge!\n";
cout<<"Please type in your name to be judged!\n";
cin>> name;
if ( name == 'nhoJeNi' ) {
cout<<"You are very cool!\n";
}
else {
cout<<"You aren't cool!\n";
}
}