[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

44 / 90

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

#include<stdio.h> 
void main ( )
{
printf("\n Hello");
printf("\b world");
printf("\r Cup");
}

AHello

BHello World

CCup

Dworld

Answer: Option (Login/Signup)

Show Explanation

If line 4 and 5 gets executed, it will print Hell world on the screen, due to '\b'.

Now, when line 4, 5 and 6 gets executed, it will print Cupl world on the screen, due to '\r' the control goes to the starting point and re-writes Hel with Cup.

So, the correct answer will be Cupl world

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here