diff options
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index ba6bd72..3e4a160 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -14,9 +14,23 @@ int main() float width, length, area, ratio; cout << "Enter width (cm) : "; - cin >> width; + cin >> width; + while (width < 1 || width > 400) + { + cout << "value must be between 1 and 400" << endl; + cout << "Enter width (cm) : "; + cin >> width; + } cout << "Enter length (cm) : "; cin >> length; + while (length < 1 || length > 400) + { + cout << "value must be between 1 and 400" << endl; + cout << "Enter length (cm) : "; + cin >> length; + } + + cout << "width: "; cout << width<< endl; |