C Fundamentals - Study Mode

[#76] Which of the following is a ternary operator?
Correct Answer

(C) ?:

[#77] Which of the following are unary operators?
Correct Answer

(D) all of the mentioned

[#78] Which of the following data type will throw an error on modulus operation(%)?
Correct Answer

(D) float

[#79] Which data type is most suitable for storing a number 65000 in a 32-bit system?
Correct Answer

(B) unsigned short

[#80] What will be printed after execution of the following program code? main()
{
printf("\nab")

printf("\bsi")

printf("\rha")

}
Correct Answer

(D) hai

Explanation

Solution: \n - newline - printf ( " \n ab " )

- Prints 'ab' \b - backspace - printf ( " \b si " )

- firstly ' \b ' removes 'b' from 'ab ' and then prints 'si'. So after execution of printf ( " \b si " )

it is 'asi' . \r - linefeed - printf ( " \r ha " )

- Now here ' \r ' moves the cursor to the start of the current line and then override 'asi' to 'hai' .