👁 Preview — flashcards and revision are unlocked. Tracking which cards you've reviewed needs a subscription. Unlock all · ₹4,999
← Back to Programming Fundamentals
Revise mode

Loops and Conditionals

Subtopic mindmap

Quick recall · 230 cards

Short MCQ-style retrieval prompts. Tap a card to reveal the answer.
PYQ · 2023 Tap to reveal →
Which of the following is a high-level programming language?
C · C++
PYQ · 2022 Tap to reveal →
Consider the following C code snippet:
c\nint main() { int x = 5; printf("%d", x++ + ++x); return 0; }
What is the output of this program?
D · Undefined
PYQ Tap to reveal →
Which type of programming paradigm does Visual Basic primarily support?
C · Object-Oriented
PYQ · 2020 Tap to reveal →
What is the time complexity of the binary search algorithm in the worst case for an array of n elements?
B · B) O(log n)
PYQ · 2022 Tap to reveal →
Which of the following sorting algorithms has the best average case time complexity?
C · C) Quick Sort
PYQ Tap to reveal →
In JavaScript, what is the difference between '==' and '===' operators when comparing variables?
B · == compares values only, === compares both value and type
PYQ Tap to reveal →
What will be the output of the following JavaScript expression: 2 * '2' + '2' + 2?
B · '42'
PYQ Tap to reveal →
What is the main difference between loops and conditionals (if/elif/else)?
B · B. Conditionals check conditions, loops iterate
Conditionals (if/else) execute code blocks based on boolean conditions once. Loops (for/while) repeatedly execute code blocks until a condition fails. Answer B correctly states this distinction[7].
PYQ Tap to reveal →
Identify the error in the following function declaration:
sql
CREATE FUNCTION GetDeptCount(dept_name VARCHAR)
RETURN INTEGER AS
SELECT COUNT(*) FROM instructor WHERE department = dept_name;
B · B) Missing BEGIN...END block
PYQ Tap to reveal →
Which parameter passing method passes **the actual variable** so changes inside the procedure affect the original variable?

A) BYVAL
B) BYREF
C) VALUE
D) REFERENCE
B · B) BYREF
PYQ · 2024 Tap to reveal →
An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the following options represents the first three elements in the heapified array?
A · 131, 101, 90
PYQ Tap to reveal →
Which of the following is NOT an Object Oriented Programming language?
D · C
Question bank Tap to reveal →
Which of the following is an example of a low-level programming language?
B · Assembly
Assembly language is considered a low-level programming language because it is closely related to machine code and hardware instructions.
Question bank Tap to reveal →
Which programming language is primarily used for web page structuring rather than general-purpose programming?
C · HTML
HTML is a markup language used for structuring web pages, not a general-purpose programming language.
Question bank Tap to reveal →
Which of the following best classifies Python programming language?
A · Procedural and Object-Oriented
Python supports multiple paradigms including procedural and object-oriented programming.
Question bank Tap to reveal →
Which characteristic of a programming language ensures that the code can be easily understood and maintained?
B · Readability
Readability refers to how easily a programmer can understand and maintain the code.
Question bank Tap to reveal →
Which of the following is NOT a characteristic of a high-level programming language?
C · Direct hardware manipulation
High-level languages abstract hardware details and do not allow direct hardware manipulation.
Question bank Tap to reveal →
Which characteristic of programming languages is most critical for optimizing program execution speed?
B · Efficiency
Efficiency refers to how well a language allows programs to run quickly and use resources optimally.
Question bank Tap to reveal →
Which programming paradigm focuses on the concept of objects containing data and methods?
C · Object-Oriented
Object-Oriented programming is based on objects that encapsulate data and behavior.
Question bank Tap to reveal →
Which of the following paradigms treats computation as the evaluation of mathematical functions and avoids changing state or mutable data?
A · Functional
Functional programming emphasizes pure functions and avoids side effects.
Question bank Tap to reveal →
In which programming paradigm is the program flow determined by events such as user actions or sensor outputs?
B · Event-Driven
Event-Driven programming is based on responding to events or messages.
Question bank Tap to reveal →
Who is known as the father of the C programming language?
A · Dennis Ritchie
Dennis Ritchie developed the C programming language at Bell Labs in the early 1970s.
Question bank Tap to reveal →
Which programming language was developed primarily for scientific computations in the 1950s?
A · FORTRAN
FORTRAN (Formula Translation) was designed for scientific and engineering calculations.
Question bank Tap to reveal →
Consider the following C code snippet:
\nint main() {
int a = 5, b = 3;
int c = a++ + ++b;
printf("%d", c);
return 0;
}
What is the output of this program?
A · 9
a++ uses the value 5 before incrementing, ++b increments b to 4 before use, so c = 5 + 4 = 9.
Question bank Tap to reveal →
Which of the following is a valid syntax to declare a pointer to an integer in C?
A · int *ptr;
In C, the correct syntax to declare a pointer to an integer is 'int *ptr;'.
Question bank Tap to reveal →
What will be the output of the following C code?
\nint main() {
int x = 10;
if (x = 5)
printf("True");
else
printf("False");
return 0;
}
A · True
The expression 'if (x = 5)' assigns 5 to x and evaluates to true (non-zero), so 'True' is printed.
Question bank Tap to reveal →
In C language, which of the following statements about the 'switch' statement is TRUE?
A · The 'switch' expression must be of integer or character type
In C, the 'switch' expression must be an integer or character type; floating-point expressions are not allowed.
Question bank Tap to reveal →
Which of the following best describes the difference between compilation and interpretation?
A · Compilation translates entire code before execution; interpretation translates code line-by-line during execution
Compilation translates the whole program into machine code before execution, while interpretation translates and executes code line-by-line.
Question bank Tap to reveal →
Which of the following best defines an algorithm?
A · A set of instructions to solve a specific problem
An algorithm is a finite set of well-defined instructions to solve a particular problem.
Question bank Tap to reveal →
Which characteristic of an algorithm ensures it will finish after a finite number of steps?
A · Finiteness
Finiteness means the algorithm must terminate after a finite number of steps.
Question bank Tap to reveal →
Which of the following is NOT a characteristic of a good algorithm?
B · Ambiguity
Ambiguity is not a characteristic of a good algorithm; algorithms must be unambiguous.
Question bank Tap to reveal →
Which algorithm design technique involves breaking a problem into smaller subproblems, solving each recursively, and combining their results?
A · Divide and Conquer
Divide and Conquer splits the problem into subproblems, solves them recursively, and combines the results.
Question bank Tap to reveal →
Which design technique is best suited for optimization problems where the solution can be built incrementally by choosing the best option at each step?
A · Greedy Method
Greedy method builds up a solution piece by piece, always choosing the next piece with the most immediate benefit.
Question bank Tap to reveal →
Which of the following is a key difference between Dynamic Programming and Divide and Conquer techniques?
A · Dynamic Programming solves overlapping subproblems; Divide and Conquer solves independent subproblems
Dynamic Programming is used when subproblems overlap and stores results to avoid recomputation, unlike Divide and Conquer.
Question bank Tap to reveal →
Refer to the diagram below showing a flowchart for finding the maximum of two numbers. What will be the output if the input numbers are 8 and 5?
A · 8
The flowchart compares two numbers and outputs the greater one; 8 is greater than 5.
Question bank Tap to reveal →
Which pseudocode snippet correctly represents a loop that prints numbers from 1 to 5?
A · FOR i = 1 TO 5 PRINT i END FOR
The FOR loop from 1 to 5 correctly prints numbers 1 through 5.
Question bank Tap to reveal →
Refer to the pseudocode snippet below. What is the output? FOR i = 1 TO 3 FOR j = 1 TO 2 PRINT i * j END FOR END FOR
A · 1 2 2 4 3 6
The nested loops print i*j for i=1 to 3 and j=1 to 2 resulting in 1 2 2 4 3 6.
Question bank Tap to reveal →
Refer to the flowchart below representing an algorithm to check if a number is even or odd. What will be the output if the input is 7?
A · Odd
7 is not divisible by 2, so the output is Odd.
Question bank Tap to reveal →
What is the time complexity of a linear search algorithm in the worst case for an array of size \( n \)?
A · O(n)
In the worst case, linear search checks each element once, resulting in O(n) time complexity.
Question bank Tap to reveal →
If an algorithm requires \( n^2 \) units of time for input size \( n \), what is its time complexity?
A · Quadratic time complexity
An algorithm with time proportional to \( n^2 \) is said to have quadratic time complexity.
Question bank Tap to reveal →
Which of the following best describes space complexity?
A · Amount of memory an algorithm uses relative to input size
Space complexity measures the memory usage of an algorithm as a function of input size.
Question bank Tap to reveal →
Refer to the diagram below showing a step count of an algorithm. If the input size doubles, what happens to the time complexity assuming the steps increase from 5n to 20n?
A · Time complexity remains linear but with a higher constant factor
The time complexity is still linear (O(n)) but the constant factor increased from 5 to 20.
Question bank Tap to reveal →
Which of the following is an example of a common algorithmic problem?
A · Sorting an array
Sorting an array is a classic algorithmic problem with many known solutions.
Question bank Tap to reveal →
Which algorithm is commonly used to find the shortest path in a weighted graph?
A · Dijkstra's Algorithm
Dijkstra's algorithm finds the shortest path from a source to all vertices in a weighted graph.
Question bank Tap to reveal →
Refer to the diagram below showing the steps of the Bubble Sort algorithm on the array [4, 2, 3]. What is the array after the first pass?
A · [2, 3, 4]
Bubble sort swaps adjacent elements if they are in wrong order; after first pass, the largest element 4 moves to the end.
Question bank Tap to reveal →
Which control structure is used to execute a set of instructions only if a specified condition is true?
A · Selection
Selection control structure executes instructions based on a condition.
Question bank Tap to reveal →
Which control structure repeats a block of code while a condition remains true?
A · Iteration
Iteration repeats a block of code based on a condition.
Question bank Tap to reveal →
Refer to the pseudocode snippet below. What type of control structure is used? IF score >= 50 THEN PRINT "Pass" ELSE PRINT "Fail" END IF
A · Selection
The IF-ELSE construct is a selection control structure.
Question bank Tap to reveal →
Which of the following is the correct sequence of control structures in a typical algorithm?
A · Sequence, Selection, Iteration
Algorithms typically follow sequence, then selection, then iteration control structures.
Question bank Tap to reveal →
Refer to the diagram below showing a trace table for the algorithm that adds numbers from 1 to 3. What is the final sum?
A · 6
Sum of 1 + 2 + 3 is 6, as shown in the trace table.
Question bank Tap to reveal →
Which debugging technique involves manually following the algorithm step-by-step with sample inputs to find errors?
A · Tracing
Tracing is the process of manually following the algorithm steps to detect errors.
Question bank Tap to reveal →
Refer to the pseudocode snippet below. What is the output after debugging? SET x = 0 FOR i = 1 TO 3 x = x + i END FOR PRINT x
A · 6
The loop adds 1 + 2 + 3 resulting in 6, which is printed.
Question bank Tap to reveal →
Which of the following is NOT a common cause of errors that require debugging in algorithms?
C · Correct logic
Correct logic does not cause errors; errors arise from issues like infinite loops or wrong initialization.
Question bank Tap to reveal →
Which of the following best defines an algorithm?
A · A set of instructions to solve a specific problem
An algorithm is a finite set of well-defined instructions to solve a particular problem.
Question bank Tap to reveal →
Which characteristic of an algorithm ensures it finishes after a finite number of steps?
A · Finiteness
Finiteness means the algorithm must terminate after a finite number of steps.
Question bank Tap to reveal →
Which of the following is NOT a characteristic of a good algorithm?
B · Ambiguity
A good algorithm must be unambiguous; ambiguity is not a desirable characteristic.
Question bank Tap to reveal →
Which design technique divides a problem into smaller subproblems, solves them independently, and combines their solutions?
A · Divide and Conquer
Divide and Conquer breaks the problem into subproblems, solves them independently, and merges the results.
Question bank Tap to reveal →
Which algorithm design technique is best suited for optimization problems where subproblems overlap?
A · Dynamic Programming
Dynamic Programming is used when subproblems overlap and optimal solutions can be built from subproblem solutions.
Question bank Tap to reveal →
In which design technique does the algorithm make the locally optimal choice at each step hoping to find the global optimum?
A · Greedy Method
Greedy algorithms select the best option at each step, aiming for a global optimum.
Question bank Tap to reveal →
Which of the following is an example of a backtracking algorithm?
A · N-Queens Problem
The N-Queens problem uses backtracking to explore all possible placements.
Question bank Tap to reveal →
Which of the following is a common method to represent an algorithm?
A · Flowchart
Flowcharts visually represent the flow of control in an algorithm.
Question bank Tap to reveal →
Refer to the diagram below showing a flowchart for finding the maximum of two numbers. What is the output if inputs are A=7 and B=5?
A · 7
The flowchart compares A and B and outputs the greater value, which is 7.
Question bank Tap to reveal →
Which of the following is NOT a method to represent an algorithm?
C · Binary Tree
Binary Tree is a data structure, not a representation method for algorithms.
Question bank Tap to reveal →
Which notation is commonly used to express the time complexity of an algorithm?
A · Big O notation
Big O notation describes the upper bound of an algorithm's running time.
Question bank Tap to reveal →
Refer to the complexity graph below comparing two algorithms A and B. Which algorithm has better time complexity for large input sizes?
B · Algorithm B
Algorithm B's curve grows slower, indicating better time complexity for large inputs.
Question bank Tap to reveal →
If an algorithm has a space complexity of \( O(n^2) \), what does it imply?
A · Memory usage grows quadratically with input size
Space complexity \( O(n^2) \) means memory usage increases proportional to the square of input size.
Question bank Tap to reveal →
Which of the following time complexities represents the fastest growing function as input size increases?
A · O(2^n)
Exponential time \( O(2^n) \) grows faster than polynomial or linear time complexities.
Question bank Tap to reveal →
Which of the following algorithms has the best average-case time complexity for sorting?
A · Merge Sort
Merge Sort has average-case time complexity of \( O(n \log n) \), better than the others which are \( O(n^2) \).
Question bank Tap to reveal →
Which algorithm is commonly used to find the shortest path in a weighted graph?
A · Dijkstra's Algorithm
Dijkstra's algorithm finds the shortest path from a source to all vertices in a weighted graph.
Question bank Tap to reveal →
Refer to the pseudocode snippet below for binary search. What is the key advantage of binary search over linear search?
A · Faster search with time complexity \( O(\log n) \)
Binary search divides the search space in half each time, resulting in \( O(\log n) \) time complexity.
Question bank Tap to reveal →
Which of the following algorithms is NOT a divide and conquer algorithm?
A · Bubble Sort
Bubble Sort is a simple comparison-based algorithm, not divide and conquer.
Question bank Tap to reveal →
Which method is used to prove the correctness of an algorithm?
A · Mathematical Induction
Mathematical induction is commonly used to prove correctness, especially for recursive algorithms.
Question bank Tap to reveal →
Which of the following statements about algorithm efficiency is TRUE?
A · An efficient algorithm uses minimal resources and runs faster
Efficiency relates to resource usage and speed, independent of language or correctness.
Question bank Tap to reveal →
Refer to the diagram below showing the step sequence of Euclid's algorithm for GCD of 48 and 18. What is the GCD?
A · 6
Euclid's algorithm computes GCD(48,18) as 6 by repeated remainder steps.
Question bank Tap to reveal →
Which of the following is a method to improve algorithm efficiency?
A · Reducing time complexity
Reducing time complexity improves efficiency by decreasing execution time.
Question bank Tap to reveal →
Which of the following is TRUE about algorithm correctness?
A · An algorithm is correct if it produces the expected output for all valid inputs
Correctness means the algorithm produces the correct output for every valid input.
Question bank Tap to reveal →
Given a recursive algorithm defined as T(n) = 3T(n/4) + n^1.5 for n > 1 and T(1) = 1, which of the following best describes the asymptotic time complexity of the algorithm?
D · T(n) = Θ(n^{1.5}) since the Master Theorem case 1 applies with f(n) polynomially larger than n^{log_b a}.
Question bank Tap to reveal →
An algorithm implements a hash function h(k) = (3k + 7) mod 53 for keys k. If keys are multiples of 53, which of the following statements about the distribution of hash values and collision likelihood is TRUE?
A · All keys map to the same hash value 7, causing maximum collisions and poor distribution.
Question bank Tap to reveal →
What is the primary purpose of a variable in programming?
A · To store data values that can change during program execution
Variables are used to store data values that a program can manipulate and change during its execution.
Question bank Tap to reveal →
Which of the following best describes a variable in programming?
B · A named memory location used to store data
A variable is a named memory location that holds data which can be changed during program execution.
Question bank Tap to reveal →
Which of the following is NOT a valid variable name in most programming languages?
C · 2ndValue
Variable names cannot start with a digit in most programming languages.
Question bank Tap to reveal →
Which of the following is a recommended convention for naming variables in programming?
C · Using meaningful and descriptive names in camelCase
Using meaningful and descriptive names in camelCase is a common and recommended convention for variable naming.
Question bank Tap to reveal →
Which of the following is NOT a primitive data type in most programming languages?
C · Array
Array is a composite data type, not a primitive data type like integer, float, or character.
Question bank Tap to reveal →
Which data type would be most appropriate to store the value 3.14159 in a program?
B · float
The float data type is used to store decimal or floating-point numbers like 3.14159.
Question bank Tap to reveal →
Consider a programming language with the following data types: int (4 bytes), short (2 bytes), long (8 bytes). Which type qualifier would you use to declare a variable that requires the largest range of integer values?
C · long
The 'long' data type uses 8 bytes and can store the largest range of integer values among the options.
Question bank Tap to reveal →
Which of the following statements about type qualifiers is TRUE?
B · The 'volatile' qualifier indicates a variable may be changed unexpectedly by external factors
The 'volatile' qualifier tells the compiler that the variable can be changed unexpectedly, such as by hardware or another thread.
Question bank Tap to reveal →
Which of the following is a correct way to declare and initialize an integer variable named 'count' with the value 10 in C?
A · int count = 10;
The correct syntax in C for declaring and initializing an integer variable is 'int count = 10;'.
Question bank Tap to reveal →
What will be the value of variable 'a' after the following C code executes?
int a = 5;
a = (float)a / 2;
A · 2
Since 'a' is an integer, the float division result 2.5 is truncated to 2 when assigned back to 'a'.
Question bank Tap to reveal →
Which of the following correctly describes typecasting in programming?
B · Explicitly converting a variable from one data type to another
Typecasting is the explicit conversion of a variable from one data type to another by the programmer.
Question bank Tap to reveal →
What will be the output of the following C code snippet?
float x = 5.7;
int y = (int) x;
printf("%d", y);
A · 5
Typecasting float 5.7 to int truncates the decimal part, resulting in 5.
Question bank Tap to reveal →
Which of the following is a constant literal in programming?
A · "Hello World"
A constant literal is a fixed value directly used in code, such as a string literal "Hello World".
Question bank Tap to reveal →
Which of the following best defines a variable in programming?
A · A named storage location in memory that holds a value
A variable is a named memory location used to store data that can be changed during program execution.
Question bank Tap to reveal →
What is the primary purpose of using variables in a program?
A · To store and manipulate data during program execution
Variables allow programs to store data temporarily and manipulate it as needed during execution.
Question bank Tap to reveal →
Which of the following is NOT a primitive data type in most programming languages?
C · Array
Arrays are composite data types, not primitive. Primitive types include integers, booleans, and characters.
Question bank Tap to reveal →
Which data type would be most appropriate to store the value 3.14159?
B · float
The float data type is used to store decimal numbers like 3.14159.
Question bank Tap to reveal →
Which of the following data types typically requires the most memory in a 32-bit system?
C · double
Double precision floating-point numbers (double) usually require 8 bytes, more than int (4 bytes), char (1 byte), or bool (1 byte).
Question bank Tap to reveal →
What is the correct way to declare and initialize an integer variable named 'count' with the value 10 in C?
A · int count = 10;
In C, the correct syntax for declaring and initializing an integer variable is 'int count = 10;'.
Question bank Tap to reveal →
Given the declaration: \( float price = 99.99; \) Which of the following is a valid way to change the value of price to 120.50?
A · price = 120.50;
To change the value of an already declared variable, assign the new value directly using '='.
Question bank Tap to reveal →
What will be the output of the following code snippet?

\( int a = 5; \)
\( double b = (double) a / 2; \)
\( printf(\"%.2f\", b); \)
A · 2.50
Casting 'a' to double before division results in floating-point division: 5.0 / 2 = 2.5, printed as 2.50 with formatting.
Question bank Tap to reveal →
Which of the following statements about typecasting is TRUE?
B · Explicit typecasting requires the programmer to specify the conversion
Explicit typecasting requires the programmer to specify the conversion, unlike implicit typecasting which is automatic.
Question bank Tap to reveal →
Consider the following C code:

\( int x = 10; \)
\( { \)
\( \quad int x = 20; \)
\( \quad printf(\"%d\", x); \)
\( } \)
\( printf(\"%d\", x); \)

What will be the output?
A · 20 10
The inner block declares a new variable 'x' that shadows the outer 'x'. Inside the block, 20 is printed; outside, the original 10 is printed.
Question bank Tap to reveal →
Which of the following correctly defines a constant in C?
C · Both A and B
Constants can be defined using #define preprocessor or the const keyword. Both methods are valid.
Question bank Tap to reveal →
Which of the following is a valid literal for a boolean constant in most programming languages?
D · All of the above
Depending on the language, boolean literals can be 'true', 'True', or 'TRUE'. For example, Python uses 'True', Java uses 'true'.
Question bank Tap to reveal →
What is the result of the following typecasting operation?

\( double d = 9.99; \)
\( int i = (int) d; \)
\( printf(\"%d\", i); \)
A · 9
Casting a double to int truncates the decimal part, so 9.99 becomes 9.
Question bank Tap to reveal →
In a language where 'char' is 8-bit unsigned and 'int' is 32-bit signed, consider the following code snippet: char c = 250;\nint i = -10;\nint result = c + i; What is the value of 'result' after execution?
A · A) 240
Question bank Tap to reveal →
In a language where 'float' is 32-bit IEEE 754 and 'double' is 64-bit IEEE 754, consider the following: float f = 1.0e-38; double d = (double)f; If we cast 'd' back to float, what is the expected value and why?
C · C) A denormalized float value close to 1.0e-38, due to precision loss.
Question bank Tap to reveal →
In a programming language, a 'short' is 16-bit signed, and 'unsigned short' is 16-bit unsigned. If a 'short' variable s = -1 and an 'unsigned short' variable u = 65535, what is the result of the expression (s == u)?
A · A) True, because -1 in signed short equals 65535 in unsigned short due to bitwise representation.
Question bank Tap to reveal →
In a system where 'int' is 32-bit signed and 'long' is 64-bit signed, consider the following code: \nint a = 2147483647; long b = (long)a + 1; What is the value of 'b' and why?
A · A) 2147483648, because 'a' is promoted to long before addition.
Question bank Tap to reveal →
Consider a variable 'z' declared as a 20-bit signed integer (two's complement). If z is assigned the decimal value 524287, what happens when 1 is added to z and stored back in the same variable?
A · A) The value becomes -524288 due to overflow wrap-around.
Question bank Tap to reveal →
In a language where 'bool' is stored as an 8-bit unsigned integer (0 for false, 1 for true), consider the following code: bool a = true;\nint x = 255; bool b = (bool)x; What is the value of 'b' after this assignment?
A · A) True, because any non-zero integer converts to true.
Question bank Tap to reveal →
A variable 'n' is declared as a 32-bit signed integer and initialized with the value -2147483648. If we perform the operation n = -n, what is the resulting value stored in 'n'?
B · B) -2147483648, because negation overflows and value remains unchanged.
Question bank Tap to reveal →
In a programming language, the 'long long' data type is 64-bit signed. If a variable 'val' is assigned the hexadecimal value 0xFFFFFFFFFFFFFFFF, what is the decimal value of 'val'?
B · B) -1, due to two's complement representation.
Question bank Tap to reveal →
In a language where 'int' is 16-bit signed, what is the result of the expression: \nint a = 30000;\nint b = 10000;\nint c = a + b; What is the value stored in 'c' after execution?
B · B) -25536, due to overflow wrap-around.
Question bank Tap to reveal →
A variable 'f' is declared as a 32-bit float (IEEE 754). If 'f' is assigned the value 1.0e-45 (the smallest positive subnormal float), what happens when we multiply 'f' by 2?
C · C) The result is a larger subnormal float approximately 2.0e-45.
Question bank Tap to reveal →
Given a variable 'x' declared as a 24-bit unsigned integer, what is the decimal value of the binary number 111111111111111111111111 stored in 'x'? Also, what happens if 1 is added to 'x'?
A · A) Value: 16777215; Adding 1 results in 0 due to overflow wrap-around.
Question bank Tap to reveal →
Which of the following is the correct syntax for an if statement in C?
A · if (condition) { statements; }
In C, the correct syntax for an if statement requires the condition to be enclosed in parentheses and the statements inside curly braces.
Question bank Tap to reveal →
What will be the output of the following code snippet?
int x = 10;
if (x > 5) { printf("A"); } else { printf("B"); }
A · A
Since x is 10, which is greater than 5, the if condition evaluates to true and prints 'A'.
Question bank Tap to reveal →
Which of the following conditional statements allows multiple conditions to be checked sequentially?
A · if-else if-else
The if-else if-else ladder allows checking multiple conditions one after another.
Question bank Tap to reveal →
In C programming, what is the output of the following code?
int a = 5;
if (a == 5)
if (a > 3)
printf("X");
else
printf("Y");
A · X
The nested if checks if a > 3, which is true, so it prints 'X'.
Question bank Tap to reveal →
Which of the following is NOT a valid relational operator used in conditional statements?
C · ><
The operator '><' is not a valid relational operator in C or most programming languages.
Question bank Tap to reveal →
What will be the output of the following code snippet?
int x = 3;
if (x > 0)
if (x < 5)
printf("A");
else
printf("B");
A · A
The else corresponds to the inner if, so since x < 5 is true, 'A' is printed.
Question bank Tap to reveal →
Which looping construct is guaranteed to execute the loop body at least once?
C · do-while loop
The do-while loop executes the body first and then checks the condition, ensuring at least one execution.
Question bank Tap to reveal →
What is the output of the following code?
int i = 0;
while(i < 3) { printf("%d", i); i++; }
A · 012
The loop prints values 0, 1, and 2 sequentially before i becomes 3 and loop terminates.
Question bank Tap to reveal →
Which of the following loops is best suited when the number of iterations is known beforehand?
C · for loop
For loops are typically used when the number of iterations is known in advance.
Question bank Tap to reveal →
What will be the output of the following code?
for(int i = 1; i <= 5; i++) { if(i == 3) break; printf("%d", i); }
B · 12
The loop prints 1 and 2, then breaks when i == 3, so 3, 4, 5 are not printed.
Question bank Tap to reveal →
Consider the following code snippet:
int i = 0;
do { i++; if(i == 2) continue; printf("%d", i); } while(i < 3);
What is the output?
B · 13
When i == 2, continue skips the printf, so only 1 and 3 are printed.
Question bank Tap to reveal →
Which jump statement immediately terminates the nearest enclosing loop or switch statement?
B · break
The break statement terminates the nearest loop or switch statement immediately.
Question bank Tap to reveal →
What is the effect of the continue statement inside a loop?
B · Skips the remaining statements in the current iteration and proceeds to the next iteration
Continue skips the rest of the current iteration and moves control to the next iteration of the loop.
Question bank Tap to reveal →
What will be the output of the following code?
for(int i=1; i<=3; i++) { if(i==2) break; printf("%d", i); } printf("Done");
B · 1Done
Loop prints 1, then breaks when i==2, then prints 'Done'.
Question bank Tap to reveal →
Which of the following is a valid use of the goto statement in C?
A · To jump to a labeled statement within the same function
Goto can only jump to labels within the same function.
Question bank Tap to reveal →
What will be the output of the following nested control structure?
int x = 4;
if (x > 0) {
if (x < 5) {
printf("Inside");
} else {
printf("Outside");
}
} else {
printf("None");
}
A · Inside
x is 4, so both conditions are true, printing 'Inside'.
Question bank Tap to reveal →
Consider the following code:
for(int i=1; i<=3; i++) {
for(int j=1; j<=2; j++) {
if(i==2 && j==1) break;
printf("%d%d", i, j);
}
}
What is the output?
C · 111213
When i=2 and j=1, inner loop breaks, so output is 11 12 13.
Question bank Tap to reveal →
In nested if-else statements, which else corresponds to which if?
A · Each else corresponds to the nearest preceding unmatched if
In nested if-else, each else is matched with the closest unmatched if above it.
Question bank Tap to reveal →
What is the output of the following code?
int a = 1;
if(a) {
if(a == 1) {
printf("One");
} else {
printf("Not One");
}
} else {
printf("Zero");
}
A · One
a is 1, so both if conditions are true, printing 'One'.
Question bank Tap to reveal →
Which of the following is the correct syntax for a switch-case statement in C?
A · switch(expression) { case value: statements; break; default: statements; }
The correct syntax uses parentheses for expression and curly braces for cases and default.
Question bank Tap to reveal →
What will be the output of the following code?
int x = 2;
switch(x) {
case 1: printf("One"); break;
case 2: printf("Two"); break;
default: printf("Default");
}
B · Two
Since x is 2, the case 2 block executes and prints 'Two'.
Question bank Tap to reveal →
What happens if the break statement is omitted in a switch-case block?
B · Execution falls through to subsequent cases until a break is found
Without break, execution continues into the next case(s) until a break or end of switch.
Question bank Tap to reveal →
Which of the following data types can be used as the expression in a switch statement in C?
A · int, char, enum
Switch expression must be integral type like int, char, or enum; float and strings are not allowed.
Question bank Tap to reveal →
Which of the following best describes the semantics of a while loop?
B · Check the condition before each iteration and execute the loop body if true
While loop checks the condition before each iteration and executes the body only if condition is true.
Question bank Tap to reveal →
Which of the following is the correct syntax for a for loop in C?
A · for(initialization; condition; increment) { statements; }
The for loop syntax is for(initialization; condition; increment) followed by the loop body.
Question bank Tap to reveal →
What is the output of the following code?
int i = 0;
while(i < 3)
printf("%d", i++);
printf("Done");
A · 012Done
The while loop prints 0,1,2 and then 'Done' is printed.
Question bank Tap to reveal →
Which of the following statements about control structures is TRUE?
B · Control structures determine the flow of execution in a program
Control structures such as loops and conditionals control the flow of execution in programs.
Question bank Tap to reveal →
Which of the following is the correct syntax for a nested if statement in C?
B · if (condition1) { if (condition2) { /* statements */ } }
A nested if statement requires the inner if to be enclosed within the outer if's block using braces.
Question bank Tap to reveal →
What will be the output of the following code snippet?
int x = 10;
if (x > 5)
if (x < 15)
printf("A");
else
printf("B");
else
printf("C");
A · A
Since x is 10, it satisfies both conditions (x > 5 and x < 15), so "A" is printed.
Question bank Tap to reveal →
Which of the following statements about if-else is TRUE?
A · An if statement can exist without an else block
The else block is optional; an if statement can stand alone without else.
Question bank Tap to reveal →
Consider the following code:
int num = 2;
switch(num) {
case 1: printf("One"); break;
case 2: printf("Two");
case 3: printf("Three"); break;
default: printf("Default");
}
What is the output?
A · TwoThree
Since there is no break after case 2, execution falls through to case 3, printing "TwoThree".
Question bank Tap to reveal →
Which data type can be used as the controlling expression in a switch statement in C?
A · int and char
Switch statements in C accept integral types like int and char but not float, double, or string.
Question bank Tap to reveal →
What will be the output of the following code?
int x = 3;
switch(x) {
case 1: printf("One"); break;
case 2: printf("Two"); break;
default: printf("Default");
case 3: printf("Three"); break;
}
B · DefaultThree
Since case 3 is after default without break, default executes first then case 3, printing "DefaultThree".
Question bank Tap to reveal →
How many times will the loop execute?
for(int i = 0; i < 5; i++) {
printf("%d", i);
}
B · 5
The loop runs from i=0 to i=4, executing 5 times.
Question bank Tap to reveal →
What is the difference between while and do-while loops?
B · do-while executes at least once; while may not execute
do-while executes the loop body first, so it runs at least once; while checks condition first.
Question bank Tap to reveal →
What will be the output of this code?
int i = 0;
do {
printf("%d", i);
i++;
} while(i < 3);
A · 012
The do-while loop prints 0,1,2 as i increments from 0 to 2.
Question bank Tap to reveal →
What is the output of the following code?
for(int i=0; i<5; i++) {
if(i == 3)
break;
printf("%d", i);
}
B · 012
Loop breaks when i equals 3, so only 0,1,2 are printed.
Question bank Tap to reveal →
What does the continue statement do inside a loop?
B · Skips the current iteration and continues with next
continue skips the remaining statements in current iteration and proceeds with next iteration.
Question bank Tap to reveal →
Which of the following is a valid use of goto statement?
A · Jumping to a label inside the same function
goto can only jump to labels within the same function scope.
Question bank Tap to reveal →
What will be the output of this code?
int i = 0;
while(i < 5) {
if(i == 2) {
i++;
continue;
}
printf("%d", i);
i++;
}
B · 0134
When i==2, continue skips printf, so 2 is not printed; other values are printed.
Question bank Tap to reveal →
Which of the following best describes decision making in programming?
B · Choosing between different paths based on conditions
Decision making involves choosing program flow paths based on conditions.
Question bank Tap to reveal →
Which control structure is most appropriate for checking multiple discrete values of a variable?
B · switch case
switch case is designed for checking multiple discrete values efficiently.
Question bank Tap to reveal →
Consider the flow control logic:
if (A) {
if (B) {
statement1;
} else {
statement2;
}
} else {
statement3;
}
Which statement executes if A is false?
C · statement3
If A is false, the else block executes statement3.
Question bank Tap to reveal →
Which of the following is a logical error in control structures?
B · Using assignment operator (=) instead of equality (==) in condition
Using = instead of == in conditions causes logical errors as assignment happens instead of comparison.
Question bank Tap to reveal →
What kind of error is caused by an infinite loop due to incorrect loop condition?
C · Logical error
Infinite loops due to wrong conditions are logical errors as syntax is correct but logic fails.
Question bank Tap to reveal →
What will be the output of the code?
int a = 5;
if (a = 3) {
printf("True");
} else {
printf("False");
}
A · True
Assignment inside if sets a=3 and evaluates to true (non-zero), so "True" is printed; this is a logical error.
Question bank Tap to reveal →
How many times will the following loop execute?
int i = 0;
while(i < 3) {
printf("%d", i);
// missing i++
}
B · Infinite times
Since i is never incremented, condition remains true forever causing an infinite loop (logical error).
Question bank Tap to reveal →
What will be the output of this code?
for(int i=1; i<=3; i++) {
if(i==2)
goto label;
printf("%d", i);
}
label:
printf("End");
A · 1End
When i==2, goto jumps to label skipping printf for 2 and 3, so output is "1End".
Question bank Tap to reveal →
Which of the following best describes a loop in programming?
B · A control structure that repeats a block of code multiple times
A loop is a control structure that allows repeated execution of a block of code as long as a specified condition is true.
Question bank Tap to reveal →
What will be the output of the following code snippet?
int i = 1;
while(i <= 3) {
printf("%d ", i);
i++;
}
A · 1 2 3
The while loop starts with i=1 and prints i while i is less than or equal to 3, incrementing i each time. Hence, output is '1 2 3'.
Question bank Tap to reveal →
Which of the following is NOT a characteristic of loops in programming?
B · They always execute at least once
Not all loops execute at least once; for example, a while loop may not execute if the condition is false initially. Only do-while loops guarantee at least one execution.
Question bank Tap to reveal →
Which loop guarantees execution of the loop body at least once?
C · do-while loop
The do-while loop executes the loop body first and then checks the condition, ensuring at least one execution.
Question bank Tap to reveal →
Consider the following code snippet:
for(int i = 0; i < 5; i++) {
if(i == 3) break;
printf("%d ", i);
}
What is the output?
B · 0 1 2
The loop breaks when i equals 3, so it prints 0, 1, and 2 before exiting.
Question bank Tap to reveal →
What will be the output of the following code?
int i = 0;
while(i < 5) {
i++;
if(i == 3) continue;
printf("%d ", i);
}
B · 1 2 4 5
When i equals 3, continue skips the printf statement, so 3 is not printed.
Question bank Tap to reveal →
Analyze the following nested loop:
for(int i = 1; i <= 3; i++) {
for(int j = 1; j <= 2; j++) {
printf("%d%d ", i, j);
}
}
What is the output?
A · 11 12 21 22 31 32
The outer loop runs i from 1 to 3, inner loop runs j from 1 to 2, printing pairs i and j in order.
Question bank Tap to reveal →
What is the time complexity of the following nested loops?
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
// constant time operation
}
}
B · O(n^2)
The outer loop runs n times and for each iteration, the inner loop runs n times, resulting in O(n^2) time complexity.
Question bank Tap to reveal →
Which of the following is a valid syntax for an if-else statement in C?
A · if(condition) { } else { }
In C, the correct syntax uses parentheses for the condition and braces for the blocks: if(condition) { } else { }.
Question bank Tap to reveal →
What will be the output of the following code?
int x = 10;
if(x > 5) {
printf("Greater");
} else {
printf("Smaller");
}
A · Greater
Since x is 10 which is greater than 5, the if block executes printing 'Greater'.
Question bank Tap to reveal →
Which conditional statement is best suited for selecting one among many discrete values of a variable?
D · switch statement
The switch statement is designed to select one among many discrete values of a variable efficiently.
Question bank Tap to reveal →
Consider the following code snippet:
int num = 2;
switch(num) {
case 1: printf("One"); break;
case 2: printf("Two"); break;
default: printf("Other");
}
What is the output?
B · Two
Since num is 2, the case 2 block executes printing 'Two'.
Question bank Tap to reveal →
What is the result of the logical expression: (5 > 3) && (2 < 4)?
A · true
Both conditions are true, so the logical AND (&&) results in true.
Question bank Tap to reveal →
Evaluate the output of the following code:
int a = 5, b = 10;
if(a > 0 || b < 5) {
printf("Yes");
} else {
printf("No");
}
A · Yes
The logical OR (||) evaluates to true because a > 0 is true, so 'Yes' is printed.
Question bank Tap to reveal →
What is a common cause of an infinite loop in programming?
A · Loop condition never becomes false
An infinite loop occurs when the loop's exit condition is never met, causing it to run indefinitely.
Question bank Tap to reveal →
Identify the off-by-one error in the following loop:
for(int i = 1; i <= 10; i++) {
printf("%d ", i);
}
Which of the following is true?
A · The loop correctly prints numbers 1 to 10
The loop runs from i=1 to i=10 inclusive, correctly printing numbers 1 to 10 without off-by-one error.
Question bank Tap to reveal →
Which of the following best describes a loop in programming?
B · A control structure that repeats a block of code multiple times
A loop is a control structure that allows repeated execution of a block of code until a certain condition is met.
Question bank Tap to reveal →
What will be the output of the following pseudocode?
Initialize count = 1
While count <= 3
Print count
Increment count by 1
End While
A · 1 2 3
The loop runs while count is less than or equal to 3, printing 1, 2, and 3 sequentially.
Question bank Tap to reveal →
Which of the following is NOT a characteristic of loops?
B · Loops always execute at least once
Not all loops execute at least once; for example, a 'while' loop may not execute if the condition is false initially.
Question bank Tap to reveal →
Which loop guarantees execution of the loop body at least once?
C · do-while loop
The do-while loop executes the loop body first and then checks the condition, ensuring at least one execution.
Question bank Tap to reveal →
What is the output of the following C code snippet?
for(int i = 1; i <= 3; i++) {
printf("%d ", i);
}
while(int j = 1; j <= 3;) {
printf("%d ", j);
j++;
}
C · Compilation error due to while syntax
The while loop syntax is incorrect because variable initialization cannot be done inside the while condition like that.
Question bank Tap to reveal →
In which scenario is a 'for' loop preferred over a 'while' loop?
A · When the number of iterations is known beforehand
A 'for' loop is ideal when the number of iterations is predetermined or known before entering the loop.
Question bank Tap to reveal →
What will be the output of the following code?
for(int i=1; i<=5; i++) {
if(i == 3) break;
printf("%d ", i);
}
B · 1 2
The loop terminates when i equals 3 due to the break statement, so only 1 and 2 are printed.
Question bank Tap to reveal →
What is the effect of the 'continue' statement inside a loop?
B · Skips the current iteration and proceeds to the next
The 'continue' statement skips the remaining code in the current iteration and moves control to the next iteration of the loop.
Question bank Tap to reveal →
Analyze the following code snippet:
int i = 0;
while(i < 5) {
if(i == 2) continue;
printf("%d ", i);
i++;
}
What will happen when this code runs?
B · Infinite loop due to i not incrementing when i == 2
When i equals 2, the continue statement skips the increment, causing i to remain 2 and resulting in an infinite loop.
Question bank Tap to reveal →
Consider the nested loop below:
for(int i=1; i<=2; i++) {
for(int j=1; j<=3; j++) {
printf("%d,%d ", i, j);
}
}
How many times will the inner loop execute in total?
D · 6
The outer loop runs 2 times, and for each iteration, the inner loop runs 3 times, so total executions = 2 * 3 = 6.
Question bank Tap to reveal →
Which of the following is a valid use case for nested loops?
B · Processing elements in a two-dimensional array
Nested loops are commonly used to process multi-dimensional data structures like 2D arrays.
Question bank Tap to reveal →
What is the output of the following nested loop?
for(int i=1; i<=2; i++) {
for(int j=1; j<=i; j++) {
printf("*");
}
printf("\n");
}
B · *\n**\n
The inner loop prints '*' j times where j goes from 1 to i, so first line prints one '*', second line prints two '*'.
Question bank Tap to reveal →
Which of the following is a correct syntax for a simple if statement in C?
B · if (x > 0) { printf("Positive"); }
The correct syntax requires parentheses around the condition and curly braces for the block.
Question bank Tap to reveal →
What will be the output of the following code?
int x = 10;
if (x > 5) {
printf("Greater");
} else {
printf("Smaller");
}
A · Greater
Since x is 10 which is greater than 5, the if block executes printing 'Greater'.
Question bank Tap to reveal →
Which conditional statement allows multiple conditions to be checked sequentially?
C · if-else-if ladder
The if-else-if ladder allows checking multiple conditions in sequence until one is true.
Question bank Tap to reveal →
What is the output of the following switch statement?
int day = 3;
switch(day) {
case 1: printf("Monday"); break;
case 2: printf("Tuesday"); break;
default: printf("Other Day");
}
C · Other Day
Since day is 3 and cases 1 and 2 don't match, the default case executes printing 'Other Day'.
Question bank Tap to reveal →
Which logical operator returns true only if both operands are true?
B · && (AND)
The logical AND operator (&&) returns true only if both operands are true.
Question bank Tap to reveal →
What is the result of the expression: (5 > 3) && (2 == 2)?
A · True
Both conditions are true, so the AND expression evaluates to true.
Question bank Tap to reveal →
Identify the error in the following loop:
for(int i=0; i<5; i++) {
printf("%d", i);
i++;
}
C · Logical error due to double increment of i
The variable i is incremented twice per iteration (once in the for loop and once inside the loop body), which may cause skipping values.
Question bank Tap to reveal →
Which of the following best defines a function in programming?
A · A block of code designed to perform a specific task and return a value
A function is a block of code designed to perform a specific task and usually returns a value.
Question bank Tap to reveal →
What is the primary purpose of a procedure in programming?
A · To perform a task without returning a value
A procedure is a subprogram that performs a task but does not return a value.
Question bank Tap to reveal →
Which of the following statements correctly describes the purpose of functions and procedures in programming?
A · They help in modularizing code and promoting code reuse
Functions and procedures modularize code, making it reusable and easier to maintain.
Question bank Tap to reveal →
Which of the following is the correct syntax to declare a function named 'sum' that takes two integers and returns an integer in C?
A · int sum(int a, int b);
In C, function declaration syntax is: return_type function_name(parameter_list);
Question bank Tap to reveal →
Given the function definition in C:
int multiply(int x, int y) { return x * y; }
Which of the following is the correct way to call this function and store the result in variable 'res'?
A · res = multiply(5, 3);
Function calls require passing arguments and assigning the returned value to a variable.
Question bank Tap to reveal →
Which of the following is a correct function definition in C that returns no value?
A · void display() { printf("Hello"); }
Functions with return type 'void' do not return a value and can perform actions like printing.
Question bank Tap to reveal →
Identify the error in the following C function declaration:
int add(int a, b);
A · Parameter 'b' is missing its type
All parameters must have their types specified in the function declaration.
Question bank Tap to reveal →
Which parameter passing mechanism allows a function to modify the actual argument passed to it?
A · Pass by reference
Pass by reference passes the address, allowing the function to modify the original variable.
Question bank Tap to reveal →
In C, which of the following correctly demonstrates passing an integer parameter by value to a function?
A · void func(int x) { x = 10; }
In C, parameters are passed by value by default; passing by reference requires pointers.
Question bank Tap to reveal →
Which of the following parameter passing methods is most efficient for passing large data structures without copying the entire data?
A · Pass by reference
Pass by reference passes the address, avoiding copying large data structures.
Question bank Tap to reveal →
Consider the following C++ function prototype:
void update(int &a);
What type of parameter passing is used here?
A · Pass by reference
The '&' symbol in parameter indicates pass by reference in C++.
Question bank Tap to reveal →
Which of the following is a valid return type for a function that does not return any value?
A · void
The 'void' return type indicates the function does not return any value.
Question bank Tap to reveal →
What will be the return type of a function declared as:
void display();
A · No return value
Functions declared with 'void' return no value.
Question bank Tap to reveal →
Which of the following statements about void functions is true?
A · They perform actions but do not return any value
Void functions perform tasks but do not return values.
Question bank Tap to reveal →
Which of the following variables has local scope inside a function?
A · Variables declared inside the function body
Variables declared inside a function have local scope and lifetime limited to the function execution.
Question bank Tap to reveal →
What happens to the lifetime of a local variable declared inside a function when the function call ends?
A · The variable is destroyed and memory is freed
Local variables exist only during the function execution and are destroyed afterward.
Question bank Tap to reveal →
Which of the following statements about static variables inside functions is correct?
A · They retain their value between function calls
Static variables inside functions retain their value between calls and have lifetime of the entire program.
Question bank Tap to reveal →
Analyze the following code snippet:
void func() {
int x = 5;
x++;
}
What is the scope and lifetime of variable x?
A · Local scope, lifetime limited to function execution
Variable x is local to func() and exists only during its execution.
Question bank Tap to reveal →
Which of the following best describes a recursive function?
A · A function that calls itself directly or indirectly
A recursive function calls itself to solve smaller instances of a problem.
Question bank Tap to reveal →
What is the base case in a recursive function?
A · The condition that stops the recursion
The base case prevents infinite recursion by providing a stopping condition.
Question bank Tap to reveal →
Consider the following recursive function to calculate factorial:
int fact(int n) {
if (n == 0) return 1;
else return n * fact(n - 1);
}
What will happen if the base case is omitted?
A · The function will cause infinite recursion and likely crash
Without a base case, recursion never stops, causing stack overflow.
Question bank Tap to reveal →
Which of the following is a major difference between a procedure and a function?
A · A function returns a value; a procedure does not
Functions return values, whereas procedures perform tasks without returning values.
Question bank Tap to reveal →
In which scenario is it more appropriate to use a procedure instead of a function?
A · When no value needs to be returned after performing an action
Procedures are used when the task does not require returning a value.
Question bank Tap to reveal →
Which of the following statements correctly differentiates functions and procedures?
A · Functions return values; procedures do not return values
The key difference is that functions return values, procedures do not.
Question bank Tap to reveal →
What is function overloading?
A · Defining multiple functions with the same name but different parameter lists
Function overloading allows multiple functions with the same name but different parameters.
Question bank Tap to reveal →
Which of the following is a correct example of a default argument in C++?
A · void display(int x = 10);
Default arguments are specified by assigning a value in the function declaration.
Question bank Tap to reveal →
Which of the following statements about function overloading is true?
A · Functions must differ in the number or types of parameters
Overloaded functions must differ in parameter number or types; return type alone is insufficient.
Question bank Tap to reveal →
What happens to the function call stack when a function is called?
A · A new stack frame is pushed onto the call stack
Each function call pushes a new stack frame containing parameters and local variables.
Question bank Tap to reveal →
Which of the following best describes the behavior of the call stack during nested function calls?
A · Each nested call pushes a new frame; frames are popped after function returns
Nested function calls push frames in order; frames are popped after each returns.
Question bank Tap to reveal →
Refer to the diagram below showing the call stack during recursive calls of a factorial function. Which statement is true about the stack frames? (Assume the recursion depth is 3)

A · Three stack frames are pushed before any returns occur
Each recursive call pushes a new stack frame; with depth 3, three frames exist before returns.
Question bank Tap to reveal →
Which of the following is a common method for handling errors in functions?
A · Returning error codes or status values
Functions often return error codes or status values to indicate success or failure.
Question bank Tap to reveal →
In C, which of the following is a typical way to indicate an error from a function that returns an integer?
A · Return a negative value or a specific error code
Returning negative values or specific codes is a common error signaling method in C.

Try Practice next.

Marking revisions saves to your dashboard — paywalled in preview.

Test myself in practice →
Ask a doubt
Loops and Conditionals · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.