Please enter a number between 1 to 5: -5 Please enter a number betveen 1 to 5: 9 Please enter a number between 1 to 5: 5 Enter your 1 Score (1-100) : 200 Enter your 1 Score (1-100) : 50 Enter your 2 Score (1-100) : 45 Enter your 3 Score (1-100) : -10 Enter your 3 Score (1-100) : 10 Enter your 4 Score (1-100) : 95 Enter your 5 Score (1-100) : 80 Array the way user entered: 50 45 10 95 80 Array in reverse order 180 95 10 45 50 Finding Even scores in the array entered by the user! Even Scores Array: 50 10 80 Sum of Even scores array: 140 Average of Even scores Array: 16.67 Mumber of Even scores in the Array: 3 Finding Odd acores in the array entered by the user! odd scores array: 15 95 Sum of odd scores array: 140 Average of odd scores array: 70.00 Number of Odd scores in the Array: 2
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images