Questions Related to softskills
D
Correct answer
Explanation
The do-while executes once with i=1, printing 1 and incrementing i to 2. The if(i<15) condition is true, so continue jumps back to loop condition. The while(false) condition fails, terminating the loop. Only 1 is printed. The continue statement affects loop control but the false condition guarantees single execution.
-
1212
-
121.2
-
12f(1,2)
-
12f(12)
C
Correct answer
Explanation
The macro f(a,b) uses ## (token pasting) to concatenate 1 and 2 into 12. Macro h(a) calls g(a) which stringifies with #a. So h(f(1,2)) becomes g(12) then f(1,2) as string literal. The first printf outputs f(1,2). The second printf calls g(f(1,2)) directly, which stringifies to 12. Output: f(1,2)12.
-
>5=-15
-
<5=-15
-
<5=15
-
>5=15
A
Correct answer
Explanation
When mixing signed and unsigned integers, C promotes the signed value to unsigned. -20 becomes a very large positive number (2^32-20 for 32-bit int). i+j (5 + large unsigned) exceeds 5, so the if condition is true. The printf uses %d to format j+i, which is -15 when viewed as signed. Option A is correct: >5=-15.
D
Correct answer
Explanation
Function argument evaluation order in C is unspecified (typically right-to-left). The call sum(a(),b(),c()) evaluates c() first (prints 3), then b() (prints 2), then a() (prints 1). sum() adds 1+2+3=6, which printf prints. Output: 3216. The return values are used in the sum, not the print order.
-
HP-UX-HewlettPack
-
Error
-
HP-UX_HewlettPack
-
none
B
Correct answer
Explanation
C function names cannot contain hyphens. The identifier OS_HP-UX_print is interpreted as OS_HP minus UX_print, which is invalid syntax. This causes a compilation error. Option A would be valid if the function were named OS_HP_UX_print with underscores. Hyphens are subtraction operators, not valid identifier characters.
B
Correct answer
Explanation
printf returns the number of characters printed. Working outward: innermost printf("%d",i) prints 43 and returns 2. Middle printf("%d",2) prints 2 and returns 1. Outermost printf("%d",1) prints 1 and returns 1. The printed characters appear left-to-right: 4321. Option B correctly shows this output.
-
EFFETE
-
VIGNETTE
-
PROSELYTE
-
MIRAGE
B
Correct answer
Explanation
A vignette in literature and art refers to a brief descriptive sketch or illustration that typically fades into the background at its edges - a technique used in books, photography, and visual design. The word originates from the French for little vine, referring to the border designs that originally filled this role.
-
VIGNETTE
-
PROSELYTE
-
MIRAGE
-
EFFETE
D
Correct answer
Explanation
Effete describes something that has lost its vitality, energy, or productive capacity - worn out, exhausted, decadent, or depleted. It often applies to ideas, institutions, or people who have become weak or ineffective through age or overuse. The word comes from Latin and originally meant having produced offspring.
-
MORASS
-
FAIT ACCOMPLI
-
ADJUNCT
-
QUASI-
B
Correct answer
Explanation
Fait accompli is a French loan phrase meaning an accomplished fact - something already done and irreversible. It describes a situation where an action has been completed so decisively that undoing it is impossible. The term is often used in politics and negotiations when someone presents a decision as final.
-
NOISOME
-
HIDEBOUND
-
BELLWETHER
-
RAILLERY
B
Correct answer
Explanation
HIDEBOUND correctly describes someone or something that is stubbornly prejudiced, narrow-minded, and inflexible in their opinions. The term literally means bound by tradition or old ways of thinking, making it unwilling to consider new ideas or change.