Quiz Space

Computational Thinking · Qualifier · 22 Dec 2024 · September 2024 term

Question 5: Procedure miniSum accepts three numbers as parameters and…

Question 5

+4 marksOne correct option

Procedure miniSum accepts three numbers as parameters and returns the sum of two smallest numbers.
Choose the correct code fragment to complete the procedure.

text
1 Procedure miniSum(A, B, C)
2 Sum = 0
3 ********************
4 * Fill the code *
5 ********************
6 else{
7 if(B > C and B > A){
8 Sum = A + C
9 }
10 else{
11 Sum = A + B
12 }
13 }
14 return(Sum)
15 End miniSum
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 5 of 12 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) Qualifier paper sat on 22 Dec 2024, in the September 2024 term (IIT M DS REATTEMPT AN EXAM QDQ1 22 Dec 2024). It carries 4 marks.

More questions from this paper

  1. Q1The given pseudocode is executed using the "Shopping Bills" dataset. frac stores the ratio of the number of customers w…
  2. Q2The following pseudocode is executed using the "Scores" dataset. At the end of the execution of below pseudocode, if co…
  3. Q3The following pseudocode is executed using the "Words" dataset. At the end of the execution, count stores the number of…
  4. Q4The following pseudocode is executed using the "Scores" dataset. Assume that the variable AvgT holds the value of the a…
  5. Q6The following pseudocode is executed using the "Scores" dataset. What will count represent at the end of the execution?
  6. Q7The following pseudocode is executed using the “Scores” dataset. What will A represent at the end of the execution?
  7. Q8The following pseudocode is executed using the “Olympics” dataset. Procedure doSomething accepts a table of rows that c…
  8. Q9The given pseudocode is executed using the “Olympics” table. At the end of execution, count represent the number of pai…
  9. Q10The following pseudocode is executed using the "Scores" dataset. At the end of the execution of the below pseudocode, i…
  10. Q11The given information represents a "Library" dataset and it may have some mistakes with respect to the sanity of the da…
  11. Q12The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph. …