do-while loops trouble
no matter what I input, the loop keeps running.
error is a string that contains an error method cause i'm too lazy to type a new cout every time.
1 2 3 4 5 6 7
|
do{cout<<"\nDoes your interest compound continuously?";
cin>>compounding_type;
if(compounding_type != 'y' || compounding_type != 'Y' || compounding_type != 'n' || compounding_type != 'N')
cout<<error;
}while(compounding_type != 'y' || compounding_type != 'Y' || compounding_type != 'n' || compounding_type != 'N');
|
Try changing ||
to &&
wow! facepalm.
haha
Thanks a lot.
Topic archived. No new replies allowed.