All mock tests are FREE till 31 December — register to save your progress

Match the LIST-I with LIST-II
LIST-ILIST-II
A. long signed intI. %lf
B. doubleII. %Lf
C. long doubleIII. %c
D. unsigned characterIV. %ld
Choose the correct answer from the options given below:

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. A-IV, B-I, C-II, D-III

Explanation

In C, a 'long signed int' is printed/scanned with the %ld format specifier, matching IV. A 'double' uses %lf, matching I. A 'long double' requires the capitalised %Lf specifier, matching II. An 'unsigned character' (a char value) is printed with %c, matching III. So the correct match is A-IV, B-I, C-II, D-III.

More Programming Languages and Computer Graphics questions