Computer Science and Information Technology
2022 · Paper 1
Take it one question at a time. Try an answer, then check your understanding.
Complete GATE CSE 2022 Paper 1 overview, original pages and practice · Timed previous-paper practice
Questions 19–21 of 65. Imported answers require review unless explicitly marked reviewed.
Question 19
Open questionCSMCQ1 markNeeds review
Consider the following threads, T₁, T₂, and T₃ executing on a single processor, synchronized using three binary semaphore variables, S₁, S₂, and S₃, operated upon using standard wait() and signal(). The threads can be context switched in any order and at any time.

Which initialization of the semaphores would print the sequence BCABCABCA....?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 20
Open questionCSMCQ1 markNeeds review
Consider the following two statements with respect to the matrices
,
,
and
.Statement 1:
Statement 2:
where
represents the trace of a matrix. Which one of the following holds?Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 21
Open questionCSMCQ1 markNeeds review
What is printed by the following ANSI C program?
#include<stdio.h>
int main(int argc, char *argv[])
{
int x = 1, z[2] = {10, 11};
int *p = NULL;
p = &x;
*p = 10;
p = &z[1];
*(&z[0] + 1) += 3;
printf("%d, %d, %d\n", x, z[0], z[1]);
return 0;
n}
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer