C language, control structure, repetition problem 1. Write a problem that will ask for an integer num and the range is b
Posted: Fri May 20, 2022 10:58 am
statement that will examine the num value. Print one of the following messages, depending on the value assigned to num: HISTORY, if num is 1 BIOLOGY, if num is 2 MATH, if num is 3 ECONOMICS, if num is 4 . SAMPLE OUTPUT Input a number (1-4): 5 Out of range Input a number (1-4): 2 BIOLOGY
C language, control structure, repetition problem 2. Write a program that will ask the user to give three integers: start step_by and stop. Set up а a for loop that will start at the value of start, make it increase by the value of step_by and make it stop at the value of stop SAMPLE OUTPUT Input start: 23 Input step by: 3 Input stop: 35 The sequence is 23 26 29 32 35
C language, control structure, repetition problem 1. Write a problem that will ask for an integer num and the range is between 1 and 4. Keep prompting the user for a valid integer, in case he enters an invalid value. When a successful value has been captured, write a switch C language, control structure, repetition problem 2. Write a program that will ask the user to give three integers: start step_by and stop. Set up а a for loop that will start at the value of start, make it increase by the value of step_by and make it stop at the value of stop SAMPLE OUTPUT Input start: 23 Input step by: 3 Input stop: 35 The sequence is 23 26 29 32 35