English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Write a program that asks the user to enter a float number within a range [1,5],inclusive of 1 and 5.If the user enters a value out of this range, prompt the user to re-enter until it is until this range.

2007-01-03 16:06:56 · 2 answers · asked by AlexTan 3 in Computers & Internet Programming & Design

2 answers

You can input the value in a loop and test it whether the user entered the value in range if it is incorrect then prompt the user to enter again by continuing the loop otherwise get exit from loop.

2007-01-03 17:16:39 · answer #1 · answered by rohit 1 · 0 0

sounds pretty simple, but in order to help, you need to post the code you have so far.

2007-01-04 08:51:49 · answer #2 · answered by justme 7 · 0 0

fedest.com, questions and answers