76 406
Assignments Done
Successfully Done
In May 2019

Answer to Question #38709 in C++ for Verasak Sitawan

Question #38709
B. Modify the InBetween program so that the user must reenter the second value so it is
guaranteed to be higher than the first entered value. Save the file as InBetween2.cpp.
Expert's answer
#include <stdio.h>

int main () {
int lower, upper;

scanf("%d %d", &lower, &upper);

if ( lower > upper ) {
printf("First number has to be smaller than the second one");
return 0;

for (int i = lower + 1; i < upper; i++) {
printf("%d ", i);
return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions