diff --git a/src/LAB2.c b/src/LAB2.c index 0663998..908661d 100644 --- a/src/LAB2.c +++ b/src/LAB2.c @@ -15,8 +15,20 @@ void lab_2() printf("Enter [W_min]: "); READ_EXACT("%lf", w_min); - printf("Enter [W_max]: "); - READ_EXACT("%lf", w_max); + do + { + printf("Enter [W_max]: "); + READ_EXACT("%lf", w_max); + + if (w_max < w_min) + { + printf("W_max cannot be less than W_min, try again\n"); + continue; + } + + break; + } + while (1); printf("Enter [d]: "); READ_EXACT("%d", d);