
7_sem
Quiz
•
Information Technology (IT)
•
University
•
Practice Problem
•
Hard
AKSV AKSV
Used 1+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output? int x = 10; printf("%d %d", x, x++);
10 11
11 10
Undefined behavior
10 10
Answer explanation
The expression 'x++' modifies 'x' after its current value is used. Since 'x' is evaluated twice without a sequence point, it leads to undefined behavior. Thus, the output is not predictable, making 'Undefined behavior' the correct choice.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to avoid multiple inclusions of header files?
static
extern
#pragma once
const
Answer explanation
The keyword #pragma once is used in C and C++ to prevent multiple inclusions of the same header file, ensuring that the file is included only once per compilation unit. This helps avoid redefinition errors.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output? printf("%d", sizeof("Hello"));
5
6
4
Compiler error
Answer explanation
The expression sizeof("Hello") calculates the size of the string literal, which includes the null terminator. "Hello" has 5 characters plus 1 for the null terminator, totaling 6. Thus, the correct answer is 6.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which sorting has best case O(n)?
Bubble sort
Insertion sort
Merge sort
Quick sort
Answer explanation
Insertion sort has a best case time complexity of O(n) when the input array is already sorted. In this scenario, it only requires a single pass through the array, making it more efficient than the other sorting algorithms listed.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator has the highest precedence?
* (dereference)
++
()
[]
Answer explanation
The operator with the highest precedence is '()' (parentheses), which is used for grouping expressions and function calls. It takes precedence over dereference, increment, and array subscripting operators.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which storage class allows local persistence of variables?
auto
static
register
extern
Answer explanation
The 'static' storage class allows variables to maintain their value between function calls, providing local persistence. In contrast, 'auto' and 'register' do not retain values after the function exits, and 'extern' is used for global variables.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a valid string function in standard C?
strcpy()
strcat()
strrev()
strlen()
Answer explanation
The function strrev() is not part of the standard C library. The other functions, strcpy(), strcat(), and strlen(), are valid string functions used for copying, concatenating, and measuring string length, respectively.
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
ULANGAN BAB ALGORITMA PEMROGRAMAN KELAS 8
Quiz
•
8th Grade - University
33 questions
Quiz on Lesson 1 CSU3200
Quiz
•
University
25 questions
SAS 1 Informatika 8
Quiz
•
8th Grade - University
25 questions
Seni Budaya Quiz
Quiz
•
11th Grade - University
25 questions
Mobile Teknology & IoT 1
Quiz
•
University
25 questions
UTS INFORMATIKA KELAS E
Quiz
•
8th Grade - University
25 questions
Cloud Computing Test
Quiz
•
University
25 questions
Quiz_3
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Information Technology (IT)
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
5 questions
Helping Build the Internet: Valerie Thomas | Great Minds
Interactive video
•
11th Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
19 questions
Review2-TEACHER
Quiz
•
University
15 questions
Pre2_STUDENT
Quiz
•
University
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University
