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
What is the decimal equivalent of the following 8-bit signed binary number represented using the two’s complement convention?
(11100101)2
(11100101)2
Solution
Solution
Solution
Consider the following C program:

What will be the output?
What will be the output?
Solution
Consider the code:

What will be the value of c?
What will be the value of c?
Solution
What is the correct way to access a structure member using a pointer to a structure?
Solution
We want to dynamically allocate memory at runtime for 10 integer elements and store the returned address in a pointer. Which of the following statements is correct?
Solution
In C preprocessor directives, what does the
operator do when used in macro definitions?
Solution
Consider the following C program:

What will be the output?
What will be the output?
Solution
A 4-byte integer
is stored starting at memory address
. What value will be stored at address
in a Little-Endian system?
Solution
Consider the following code:

What will be the output?
What will be the output?
Solution
What will be the output of the given code?
Solution
Solution
Assume
contains:

Consider the following C code snippet. What will be printed on the screen?

Consider the following C code snippet. What will be printed on the screen?
Solution
Consider the C program below.

What will be the output of the above C program?
What will be the output of the above C program?
Solution
Consider the following C program:

Which of the following statements are correct?
Which of the following statements are correct?
Solution
Which of the following statements about arrays in C are correct?
Solution
Which of the following statements about
in C are correct?
Solution
Which of the following file modes delete the existing content of a file when opened?
Solution
Inscript
Consider the following computation steps:
1. R[0] = 2
2. R[1] = 3
3. R[1] = R[1] + R[0]
4. R[0] = R[0] + 1
5. If R[0] ≤ 5 go to step-3, otherwise, go to step-6
6. R[2] = R[1]
What is the final value of R[2] at the end of computation?
Consider the following computation steps:
1. R[0] = 2
2. R[1] = 3
3. R[1] = R[1] + R[0]
4. R[0] = R[0] + 1
5. If R[0] ≤ 5 go to step-3, otherwise, go to step-6
6. R[2] = R[1]
What is the final value of R[2] at the end of computation?
Solution
Inscript
Consider the following C program:

What will be the output printed on the screen?
Consider the following C program:
What will be the output printed on the screen?
Solution
Inscript
Consider the following C program:

What will be the output printed on the screen?
Consider the following C program:
What will be the output printed on the screen?
Solution
Inscript
Consider the following C code:

What will be the output?
Consider the following C code:
What will be the output?
Solution
Inscript
Consider the following C code snippet. What will be the output?

Consider the following C code snippet. What will be the output?
Solution
Shape
Thickness [ / ]
3
All colors