well, a small question. when I run this (using bloodshed.net Dev-c++ compiler), after pressing enter after entering any number, letter etc, the window closes.Code:#include <iostream.h> int main () { int x; x = 5; int y; cout << "enter choice here: "; cin >> y; if (y == x) cout << "yes"; else cout << "no"; return 0; }
yes this is noobish, and yes ive looked around.
i THINK my if/else and cin tags are all right, but can someone just tell me how to work that (you should be able to tell what im trying to do. guess a number, if x, output "yes" if not output "no".
thanks.
this would solve this problem and others for me.



LinkBack URL
About LinkBacks


