C Programming & Assembly Language Nptel Week 2 Answers
Are you looking for C Programming & Assembly Language Nptel Week 2 Answers ? All weeks solutions of this Swayam course are available here.
Table of Contents

C Programming & Assembly Language Nptel Week 2 Answers (July-Dec 2025)
Course link: Click here to visit course on Nptel Website
Question 1. What expression will the register EAX bear immediately after the execution of statement 11?
a) EAX = (n & p) & ((t ⊕ e) | l)
b) EAX = (n | p) ⊕ ((t & e) | l)
c) EAX = (n | p) & ((t ⊕ e) | l)
d) EAX = (n | p) ⊕ ((t | e) & l)
Question 2. What value will the register EAX bear (in decimal) immediately after the execution of statement 11?
View Answers
Question 3. What value is present in the register EAX (expressed in decimal) when the code is run?
View Answers
Question 4. If in the above code, x is replaced with 0x80000000, what is the value present in the register EAX (in decimal) when the code is run?
View Answers
Question 5. Which of the following can be used to detect the end of a string present in the data segment in assembly?
a) CMP EBX 0x00, where EBX holds the values of 4 characters at once
b) CMP BL 0x00, where the value of a character is loaded in BL
c) CMP BYTE PTR [EBX] 0x00, where the pointer to the character is loaded in EBX
d) None of these
These are C Programming & Assembly Language Nptel Week 2 Answers
Question 6. Which of the following C statements do not get compiled to assembly statements when compiled for maximum optimizations?
a) statement 3
b) statement 4
c) statement 5
d) statement 6
e) None of the above
Question 7. If statement 7 was changed to return g, then which of the following C statements are not compiled to assembly statements when compiled for maximum optimizations?
a) statement 3
b) statement 4
c) statement 5
d) statement 6
e) None of the above
These are C Programming & Assembly Language Nptel Week 2 Answers
Question 8. How many basic ALU operations (Addition, Subtraction, Multiplication and Division) are performed during execution of the above un-optimized code?
View Answers
Question 9. How many basic ALU operations (Addition, Subtraction, Multiplication and Division) are performed during execution when maximum optimization is applied to the above code?
View Answers
Question 10. After the execution of the following code snippets, what is the value by which the variables pA and value stored in eax are incremented respectively?
a) 4, 8
b) 2, 4
c) 4, 1
d) 4, 4
e) None of the above
Question 11. Which of the following is the purpose of the assembly statement 3?
a) To initialise the C variable parity
b) To load the register EDX with the value of C variable n
c) To load the register EDX with the address of the C variable n
d) To load the register EDX with the value in the address pointed by the C variable n
Question 12. Which of the following assembly statement(s) implement the functionality of the C statement 6?
a) statement 9
b) statement 10
c) statement 11
d) statement 12
These are C Programming & Assembly Language Nptel Week 2 Answers
Question 13. Statement 12 in the assembly code maps to C statement _______.
View Answers
Question 14. If Parity is called from main, as shown below, it will print out output = _______ ?
View Answers
Question 15. If statement 1 of the C code is changed to bool Parity(short int n), then which of the following statements of the compiled assembly code change?
a) 3
b) 5
c) 11
d) 14
Question 16. Mark the valid option/s that will be printed once the above C program is executed.
a) Print = 63, 47 Return_Value = 63
b) Print = 47, 63 Return_Value = 47
c) Print = 53, 63 Return_Value = 63
d) Print = 47, 63 Return_Value = 63
These are C Programming & Assembly Language Nptel Week 2 Answers
Question 17. What is the value in the C variables a and b after statement 6 executes? (Assume that the main() function is executed first and control has been transferred to the function swap(int x, int y))
a) a = 63, b = 47
b) a = 47, b = 47
c) a = 47, b = 63
d) a = 63, b = 63
Question 18. Mark the valid option/s that will be printed once the above C program is executed.
a) Print = 63, 47
b) Print = 47, 47
c) Print = 63, 63
d) Print = 47, 63
Question 19. Mark the valid option/s that will be printed once the above C program is executed.
a) Print = 63, 47
b) Print = 63, 63
c) Print = 47, 47
d) Print = 47, 63
These are C Programming & Assembly Language Nptel Week 2 Answers