Interview Question

  • -
    0
    of 0 votes
    5
    Answers

    In C
    How Can we move the output pointer some point back?
    (say I want to print ABCD, but ABD is already printed now I have to print C in between B & D without deleting anything.)

    - niraj.nijju on July 02, 2012 in India Report Duplicate | Flag
    C

Country: India


Comment hidden because of low score. Click to expand.
0
of 0 vote

store the string in linked list. then, traverse the list with two pointers p and q;
q=p->next.
when p is pointing to B, q is pointing to D.
now, the code is,
newnode->data=c;
newnode->next=q;
p->next=newnode;
i think this should work.

- mahi on July 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

u r write...

- ashish garg on July 10, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@ashish garg...its.."u r right"...:P

- kk on July 21, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

is it really what @mahi want?

- Bin on December 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

main()
{
      printf("ABD\rABCD");
      getch();
      }

- SRK on September 29, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book walking you through every aspect of getting a job at a top tech company, while focuses on software engineering interviews.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More