Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT "DEGREE LEVEL : PROGRAMMING IN C (COMPUTER
BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
Solution
Which of the following best characterizes the C programming language?
Solution
What is the decimal equivalent of the hexadecimal number 3D?
Solution
What is the range of integer values that can be represented by an 8-bit signed integer using two's complement convention?
Solution
What is the purpose of the Program Counter (PC) in a CPU?
Solution
Consider the computations given below using the generalized memory model.
1. M[0] ← x
2. M[1] ← y
3. M[2] ← M[0] – M[1]
4. M[1] ← M[2] * M[1]
5. M[0] ← M[2] * M[0]
6. M[2] ← M[0] – M[1]
7. M[3] ← M[2]
What is the value of M[3] at the end of the execution?
1. M[0] ← x
2. M[1] ← y
3. M[2] ← M[0] – M[1]
4. M[1] ← M[2] * M[1]
5. M[0] ← M[2] * M[0]
6. M[2] ← M[0] – M[1]
7. M[3] ← M[2]
What is the value of M[3] at the end of the execution?
Solution
What will be the output of the following code?

Solution
What will be the output of the following code?

Solution
Trace the computation of the following C program fragment:

What are the final values of a, b, and c?
What are the final values of a, b, and c?
Solution
Consider the following C code.

What will be the output?
What will be the output?
Solution
Inscript
Consider the nested ternary expression:

What is the value of b after execution?
Consider the nested ternary expression:
What is the value of b after execution?
Solution
Inscript
What will be the output of the following code?

What will be the output of the following code?
Solution
Inscript
What is the value of the integer variable result after executing the following C statement?

What is the value of the integer variable result after executing the following C statement?
Solution
Which of the following CANNOT be used as valid variable names in C?
Solution
Which of the following statements about C's logical operators '&&' (AND) and '||' (OR) are correct, specifically regarding their short-circuit behavior?
Solution
Consider the following C program:

Which of the following statements about the output are true?
Which of the following statements about the output are true?
Solution
Inscript
Consider the following generalized computation:
Step 1: R0 ← M[0]
Step 2: R1 ← M[1]
Step 3: R3 ← R0 MOD 2
Step 4: IF R3 = 0 THEN GOTO Step 7, Otherwise GOTO Step 5
Step 5: R2 = R0 + R1
Step 6: GOTO Step 8
Step 7: R2 = R0 * R1
Step 8: M[2] ← R2
If M[0] = 5 and M[1] = 3, what is the value of M[2] at the end of the computation?
Consider the following generalized computation:
Step 1: R0 ← M[0]
Step 2: R1 ← M[1]
Step 3: R3 ← R0 MOD 2
Step 4: IF R3 = 0 THEN GOTO Step 7, Otherwise GOTO Step 5
Step 5: R2 = R0 + R1
Step 6: GOTO Step 8
Step 7: R2 = R0 * R1
Step 8: M[2] ← R2
If M[0] = 5 and M[1] = 3, what is the value of M[2] at the end of the computation?
Solution
Inscript
Consider the following assembly program (anything after ; is a comment).

If initially n=6, what will be the final value stored in R2 at the end of the program?
Consider the following assembly program (anything after ; is a comment).
If initially n=6, what will be the final value stored in R2 at the end of the program?
Solution
Shape
Thickness [ / ]
3
All colors