GFG Final Quiz

Quiz
•
Education
•
University
•
Hard
Mokshith Thota
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code snippet?
def func(a, b=6, c=8):
print(a, b, c)
func(1, 2)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code?
def f1(a, b, c=0, d=0, e=0):
return a + b + c + d + e
print(f1(1, *(5, 6)))
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
n = int(input())
for row_num in range(0,n+1):
row_output = ""
seq_num = row_num
while seq_num > 0:
row_output = row_output + str(seq_num)
seq_num = seq_num - 1
print(row_output)
identify mistakes in program
The program doesn't have any mistakes
program doesnot have correct logic
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
n = int(input())
for i in range(n):
if i == 0:
space = (n-1) * " "
print(space + "*")
elif i == n - 1:
print(n " ")
else:
left_spaces = (n - i - 1) * " "
stars = "* " * (i + 1)
print(left_spaces+ stars)
guess the output
It will print a triangle of asterisks with n rows
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following C code?
#include <stdio.h>
int main() {
int a = 5;
int b = a = 4;
printf("%d %d\n", a, b);
return 0;
}
5 5
44
45
54
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following C code?
#include <stdio.h>
int main() {
int a = 10, b = 20, c = 30;
printf("%d ", a);
if (a = b < c)
printf("%d ", a);
else
printf("%d ", b);
return 0;
}
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
JAVA FUNDAMENTALS

Quiz
•
University
10 questions
Квиз по Python

Quiz
•
University
15 questions
C# dolgozat

Quiz
•
11th Grade - University
10 questions
java

Quiz
•
University - Professi...
10 questions
Basic Python

Quiz
•
10th Grade - University
11 questions
Python - Data Types

Quiz
•
12th Grade - University
10 questions
Weekly Contest #11

Quiz
•
University
10 questions
sample quiz

Quiz
•
University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade