FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
You are required to design an algorithm for finding the average of six numbers, where the sum of the numbers is given. Which one of the following control structures should you use?
A
Iteration.
B
Repetition.
C
Selection.
D
Sequence.
Explanation: 

Detailed explanation-1: -You are required to design an algorithm for finding the average of six numbers, where the sum of the numbers is given. Which one of the following control structures should you use? Iteration.

Detailed explanation-2: -average = sum of all values / number of values Here we shall learn how to programmatically calculate average.

Detailed explanation-3: -Solution: Algorithm: To find the sum and product of two given numbers: Step 1: Read A, B Step 2: Let Sum= A+B Step 3: Let Product=A*B Step 4: Print Sum, Product Step 5: Stop.

Detailed explanation-4: -Algorithm Step 1: Start Step 2 :Read the three number let “a", "b", "c” form the user. Step 3: Declared a variable “sum” and “Avg". Step 4 : sum=a+b+c; Step 5: Avg=sum/3; Step 6: Display “sum “ and “Avg". Step 7 :End .

Detailed explanation-5: -Finiteness: An algorithm must terminate after a finite number of steps in all test cases.

There is 1 question to complete.