top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Try to solve this c program manually

–1 vote
388 views
main()
{
  printf("Hello\n");
  printf("welcome\\\\nNaresh");
  printf("welcome\\\\\nNaresh");
  printf("welcome\b\b");
  printf("welcome\b\bHello");
  printf("Hello\r");
  printf("welcome\rHello");
  printf("Hello\twelcome");
}
posted Jun 8, 2014 by Naga Brahma Manikanta

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
You can use codepad.org to test it...

Anyway following is the output.
Hello
welcome\nNareshwelcome\
NareshwelcomewelcomeHelloHello
welcome
HelloHello    welcome
can you explain me please how this output comes.

Similar Questions
+1 vote

How to solve UDP packet drop issues between different internal processes in Linux environment ?

+5 votes

Josephus Problem talks about a problem where there are people standing in a circle waiting to be executed. The counting out begins at some point in the circle and proceeds around the circle in a fixed direction. In each step, a certain number of people are skipped and the next person is executed. The elimination proceeds around the circle (which is becoming smaller and smaller as the executed people are removed), until only the last person remains, who is given freedom.

+2 votes

suppose we have an array of N natural numbers and asks him to solve the following queries:-
Query a:- modify the element present at index i to x.
Query b:- count the number of even numbers in range l to r inclusive.
Query c:- count the number of odd numbers in range l to r inclusive.

input:
First line of the input contains the number N. Next line contains N natural numbers.Next line contains an integer Q followed by Q queries.
a x y - modify the number at index x to y.
b x y - count the number of even numbers in range l to r inclusive.
c x y - count the number of odd numbers in range l to r inclusive.
I tried to solve using simple arrays but it isn't doing well for big constraints so I thought to use other DS with efficient algorithm so please explain appropriate algorithm.Thanks in advance.

+2 votes
void main(){
   int i=320;
   char *ptr=(char *)&i;
   printf("%d",*ptr); 
}

Please provide your explanation also?

...