I am trying to make a program that asks for a number, and if you give it the right number, it will give you a message telling you that it is either correct or incorrect.
Here's the code:
Can anyone tell me if I did something wrong or if I missed anything? I am new to cpp, so I'm kind of clueless. Thanks.Code:#include <iostream> using namespace std; int main() { int a; cout<<"Enter a number: "; cin>>a; cin.ignore(); if(a==15){ cout<<"Correct!\n"; if(a!=15){ cout<<"Incorrect!\n"; cin.get(); } }