Programming Quiz

Results

#1 Given the following procedure run, what is the output of run(25) ?

#2 If below is a binary search tree formed by inserting the elements in the order: 25, 12, 28, 15, 30, 2, 8,27; What will be the right most child of at 12?

#3 Consider the following code segment where ‘f’ is a function that is defined as shown below. What value is returned by the function call f ( 30 , 100 ) ?

#4 What will be the output of the following code segment?

#5 Which of the following correctly uses an assignment operator with the values m and n?

#6 What is the output of the following code segment?

#7 What is the output of this code?

#8 What is the output of the following program?

#9 ‘a’ is an array containing percentages of six students. We have to assign grades for each of the student based on their percentages as stated above. Consider the below two code segments (i) and (ii) and determine which of them would correctly assign the grades.

#10 Given the function “fun”, what will be the output of fun (16) ?

finish