By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,469 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

loop will stop if the user enter a number which is less than the previous

P: 1
write a c++ program that will continuously accept a number. the loop will stop if the user enter a number which is less of equal than the previous.

ex.
if i input 2
then my next input is 4
then i input 2 again
the output will be error.

please help!
Sep 8 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 10K+
P: 11,448
write a c++ program that will continuously accept a number. the loop will stop if the user enter a number which is less of equal than the previous.

ex.
if i input 2
then my next input is 4
then i input 2 again
the output will be error.

please help!
What have you done yourself already? There must be at least two variables,
possibly named 'current' and 'previous' that you can compare in a loop. Are
we on the same track?

kind regards,

Jos
Sep 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.