input problem

Feb 3, 2010 at 5:14am
hi guys, what code do I need to use to check if a integer variable got the right value when someone input a value using scanf or cin?

#include <iostream.h>

int main()
int n;
cin >> n; //User input integer? or string?
cout << n;
return 0;
}

thanks
Feb 3, 2010 at 11:09am
Topic archived. No new replies allowed.