c code output

#include
#include
void main()
{
clrscr();
printf("\nab");
printf("\bsi");
printf("\rha");
getch();
}

According to me the op should be "hai",but the output is
absi
ha
So ,plz tell how is it actually displaying this output

Replies

  • Suhel Inamdar
    Suhel Inamdar
    No yrr.. I compile this code.. its o/p is hai....
  • radha gogia
    radha gogia
    Suhel143
    No yrr.. I compile this code.. its o/p is hai....
    see this is a compiler dependent code ,try some online compiler,u will get a different answer,becoz \b and \r work differently depending on the complier

You are reading an archived discussion.

Related Posts

why the piece of code like for(int i=0;i<19;i++) { printf("hello"); } is an error,that is why in C,the variable can't be initialized within the for loop,while in other programming languages...
Hi Folks, Can you please let me know, which are the best data visualization languages (Java Scripting, JSON, css or any other) which is the best and simple to embed...
We've been comparing various 110cc scooters available in India for about Rs. 50,000 and have narrowed down on Honda Activa i and TVS Zest. Both the scooters are lightweight, offer...
Quote: It will be the biggest wheel in the world - 135m high, weighing more than 1,500 tonnes and rotating at two revolutions an hour - if everything goes to...
This festive season, a breeze of fresh air enters India's 100 cc bike segment as Hero MotoCorp launches two new motorcycles named Hero Splendor Pro Classic, India's first café racer...