Exercise :: Library Functions - Find Output of Program
- Library Functions - General Questions
- Library Functions - Find Output of Program
- Library Functions - Point Out Errors
- Library Functions - True / False Questions
- Library Functions - Yes / No Questions
6. | What will be the output of the program?
|
|||||||
Answer: Option B Explanation:
memcmp compares the first 2 bytes of the blocks dest and src as unsigned chars. So, the ASCII value of 97 is 'a'.
if((i = memcmp(dest, src, 2))==0)
When comparing the array dest and src as unsigned chars, the first 2 bytes are same in both variables.so memcmp returns '0'.
|
7. | What will function gcvt() do? |
|||||||
Answer: Option B Explanation: The gcvt() function converts a floating-point number to a string. It converts given value to a null-terminated string.
Output: |
8. | What will be the output of the program?
|
|||||||
Answer: Option B Explanation: for(i=1; i<=5; i++) Here the for loop runs 5 times.
Loop 1:
Loop 2: This above process will be repeated in Loop 3, Loop 4, Loop 5. |