C Programming & Assembly Language Nptel Week 4 Answers

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


C Programming & Assembly Language Nptel Week 4 Answers
C Programming & Assembly Language Nptel Week 4 Answers

C Programming & Assembly Language Nptel Week 4 Answers (July-Dec 2025)

Course link: Click here to visit course on Nptel Website


Question 1. By observing the compiled assembly output, the values of V3, V4, V5, and V6 respectively are:
a) V3 = 5; V4 = 7; V5 = 4; V6 = 8
b) V3 = 8; V4 = 4; V5 = 5; V6 = 7
c) V3 = 4; V4 = 2; V5 = 4; V6 = 9
d) V3 = 8; V4 = 4; V5 = 7; V6 = 5

View Answers


Question 2. What does the above C code return after execution? (Enter -1 if the executable results in an error after compiling)

View Answers


Question 3. Based on passing parameters between functions, what are the values of V1 and V2, respectively?
a) V1 = 4; V2 = 8
b) V1 = -4; V2 = -8
c) V1 = 8; V2 = 12
d) V1 = -8; V2 = -12

View Answers


Question 4. Based on the calling convention used to call the function area shown in the C code, what is the value of V7?

View Answers


Question 5. If the calling convention of the function area was __cdecl or __stdcall, then, what is the value of V8? (Mark all the correct options)
a) If __stdcall convention, then V8 = 8
b) If __stdcall convention, then V8 = 0
c) If __stdcall convention, then V8 = 16
d) If __cdecl convention, then V8 = 0
e) If __cdecl convention, then V8 = 8
f) If __cdecl convention, then V8 = 16

View Answers


Question 6. Based on the function main, what is the value of V9?

View Answers


Question 7. Assembly statement 6 is executed on calling which C statement in the above C code?
a) Statement 3
b) Statement 4
c) Statement 8
d) Statement 9

View Answers


Question 8. What data types can the above function myprintf handle correctly?
a) int as %d
b) char as %c
c) double as %f
d) string as %s

View Answers

These are C Programming & Assembly Language Nptel Week 4 Answers


Question 9. The statement 10 of the above C Program translates to the following assembly instructions:
lea eax, DWORD PTR [ebp+V1]
mov DWORD PTR [ebp+V2], eax
What are the RED highlighted integer V1?

View Answers


Question 10. What are the RED highlighted integer V2?

View Answers


Question 11. What is printed after the execution of the above C code?
a) Check: print, Integer: 4, Fraction: 2.167, UF
b) Check: print, Integer: 4, Fraction: 2.167, 4
c) Check: print, Integer: 4, Fraction: 2.17, UF
d) Check: print, Integer: 4, Fraction: 2.17, 4

View Answers


Question 12. Upon execution of statement 13 of the above C code, is the value 207 in the C variable a secure?
a) No, it can be accessed if a stack snapshot is taken after statement 11 executes.
b) Yes, it is secure, as its value is now changed to 0.

View Answers

These are C Programming & Assembly Language Nptel Week 4 Answers


Question 13. If statement 13 is changed to val = func(0); then, upon execution of statement 14 of the above C code, is the value 207 in the C variable a secure?
a) No, it can be accessed if a stack snapshot is taken after statement 11 executes.
b) Yes, it is secure as its value is now changed to 0.

View Answers


Question 14. What is the hidden integer key defined inside the function? (In decimal)

View Answers


Question 15. What is the correct input password to be entered to the function if the linear transformation of the input is directly compared with the internal key? (In decimal)

View Answers



These are C Programming & Assembly Language Nptel Week 4 Answers

Click here for all nptel assignment answers