[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Basic Concepts - Discussion

Home > C Programming > Basic Concepts > MCQs Questions Discussion

518 / 90

What will be output of the following "C" code?

#include <stdio.h>
void main()
{
printf("\nks");
printf("\bmi a");
printf("\rha n");
}

Aksmiha

Bmis

Cha na

Dhamiks

Answer: Option (Login/Signup)

Show Explanation

Line 5 will give the result as "kmi a". The escape sequence '\b'(backspace) re-writes "ks" with "kmi a".

Line 6 will give the result as "ha na". The escape sequence '\r'(carriage return) returns the control to the starting point of the string and it will rewrite "kmi a" with "ha na".

Hence, the output is ha na.

Asked In :: TCS

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here