- Program 1 Write A Program That Will Declare An Array Of 4 Integers And The User A For Loop To Ask The User To Enter Va 1 (54.27 KiB) Viewed 61 times
Program 1 Write a program that will declare an array of 4 integers and the user a loop to ask the user to enter va
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Program 1 Write a program that will declare an array of 4 integers and the user a loop to ask the user to enter va
Program 1 Write a program that will declare an array of 4 integers and the user a <for> loop to ask the user to enter values for the array elements. The asking for the values will be performed by a function called <getinteger> that you must create. Once all 4 numbers have been read in, the you must use another <for> loop to output the array elements. The getinteger function must accept no arguments and must return an integer which is the value obtained by the user after prompting them for an input. The capture below shows a sample run of the program. Please enter an integer: 43 Please enter an integer: 32 Please enter an integer: 21 Please enter an integer: 10 X[] = 43 x[1] = 32 »[2] = 21 »[3] = 10