
Programming for Problem Solving Quiz

Quiz
•
Computers
•
University
•
Medium
DINESH KUMAR
Used 1+ times
FREE Resource
38 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Pseudocode for a = 9, b = 7? Integer funn(Integer a, Integer b) Integer c Set c = 2 b = b mod c a = a mod c return a + b End function funn() [Note- mod finds the remainder after the division of one number by another. For example, the expression "5 mod 2 leaves a quotient of 2 and a remainder of 1.]
17
5
2
-5
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Pseudocode? Integer a, b, c Set a = 8, b = 6,c = 4 If(a > b) a = b Else b = a End If If(c> b) c = b Else b = c End If Print a + b + c
A: 13
B: 17
C: 14
D: 23
3.
OPEN ENDED QUESTION
3 mins • 1 pt
What will be the output of the following Pseudocode? Integer a, b, c Set a = 1, b = 1, c = 7 a = a + b if(a + b) if(b + (c ^ a)) a = 2 b = a End if End if Print a + b + c [Note- ^ is the bitwise exclusive OR operator that compares each bit of its first operand to the corresponding bit of other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. If(x) gets executed if the value inside ifo, i.e., x is not zero]
Evaluate responses using AI:
OFF
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Pseudocode? Integer p, q, r, s Set p=1, q = 1 for (each r from 0 to 2 ) for (each s from -4 to -2 ) p = p + 2 if(p > r) Continue End if p = 1 if(p > s) Jump out of the loop End if End for End for Print p + q [Note- Continue: When a continue statement is encountered inside a loop of statements inside the body of the loop for the current iteration.]
a) 13
b) 24
c) 35
d) 20
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Pseudocode for input a = 30, b = 60, C = 90? Integer a, b, c, sum Read a, b, c Set sum = a + b + c if ((sum EQUALS 180) and (a NOT EQUALS 0) and (b NOT EQUALS 0) and (c NOT EQUALS 0)) Print " Success" Otherwise Print "Fail“ End if
a) Success
b) None of the mentioned options
c) Error in the logic of the Pseudocode
d) Fail
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Pseudocode for a =1, b =2? Integer funn(Integer a, Integer b ) if(a<3 && b<4) return funn( a +1, b + 1) Else Return a + b End if End function funn() [Note: &&: Logical AND operator - the logical AND operator (&&) returns the Boolean value true (true () if both
a) 8
b) 19
c) -7
d) 7
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Pseudocode for a = 2, b = 6? Integer funn(Integer a, Integer b) If(a > 0) If(b > 0) Return a + b + funn(a + 1, 0) + funn(a + 2, 0) + funn(a + 3, 0) End If End If Return a + b End Function funn()
a) 21
b) 17
c) 37
d) 20
Create a free account and access millions of resources
Similar Resources on Wayground
43 questions
GCSE Computer Science - 2.1-2.2

Quiz
•
University
40 questions
Review MOOC1

Quiz
•
University
42 questions
CS2311 Exam 3 Review

Quiz
•
University
39 questions
Ujian Informatika Kelas IX

Quiz
•
9th Grade - University
40 questions
Basics of C Programming - 1

Quiz
•
University
40 questions
Quiz Informatika Kelas XI

Quiz
•
11th Grade - University
40 questions
CSM with Visca

Quiz
•
University
40 questions
Tugas Informatika Kelas X SMAN 1 Tjb

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University