
7-04-2024 quiz
Authored by INSPIRE [Official]
Religious Studies
Professional Development
30 Questions
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The keyword used to transfer control from a function back to the calling function is
back
return
Answer explanation
The keyword return is used to transfer control from a function back to the calling function.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Point out the error in the program
Missing parenthesis in return statement
The function should be defined as int f(int a, int b)
Redeclaration of a
None of above
Answer explanation
f(int a, int b) The variable a is declared in the function argument statement.
int a; Here again we are declaring the variable a. Hence it shows the error "Redeclaration of a"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A function cannot be defined inside another function
True
False
Answer explanation
A function cannot be defined inside the another function, but a function can be called inside a another function.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about the size of C data types?
sizeof(char) <= sizeof(int) <= sizeof(long)
sizeof(double) <= sizeof(float)
sizeof(char) > sizeof(short)
sizeof(int) == sizeof(float)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to declare a comment in C?
<!-- This is a comment -->
/* This is a comment */
// This is a comment
Both B and C are correct
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Functions cannot return more than one value at a time
True
False
Answer explanation
True, A function cannot return more than one value at a time. because after returning a value the control is given back to calling function.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the program?
Print 5, 4, 3, 2, 1
Infinite loop
Print 1, 2, 3, 4, 5
Print 5, 4, 3, 2, 1, 0
Answer explanation
Step 1: int no=5; The variable no is declared as integer type and initialized to 5.
Step 2: reverse(no); becomes reverse(5); It calls the function reverse() with '5' as parameter.
The function reverse accept an integer number 5 and it returns '0'(zero) if(5 == 0) if the given number is '0'(zero) or else printf("%d,", no); it prints that number 5 and calls the function reverse(5);.
The function runs infinetely because the there is a post-decrement operator is used. It will not decrease the value of 'n' before calling the reverse() function. So, it calls reverse(5) infinitely.
Note: If we use pre-decrement operator like reverse(--n), then the output will be 5, 4, 3, 2, 1. Because before calling the function, it decrements the value of 'n'.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
25 questions
GÁLATAS 1 Y 2
Quiz
•
Professional Development
25 questions
SINH HOẠT ĐỐ VUI ( NGÀNH ẤU )
Quiz
•
KG - Professional Dev...
25 questions
1 - La chahada
Quiz
•
Professional Development
25 questions
CCA Paskah
Quiz
•
Professional Development
25 questions
¿Quién soy en Cristo?
Quiz
•
Professional Development
28 questions
LIBRO DE LOS GÁLATAS
Quiz
•
Professional Development
25 questions
Bhagavad Gita As It Is DAY-04 (1.31-40)
Quiz
•
KG - Professional Dev...
25 questions
Tokoh tokoh Alkitab
Quiz
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade