Ebay Interview Question for Developer Program Engineers






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

#define SEM 59 //59 is ASCII value of semicolon

void main()
{
if(printf("%c",SEM))
{
}
}

- mayank July 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Its working fine. you just need to add #include<stdio.h> at the top.

- Priyanshu November 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

if you know the unicode of ;, you can print..

- Ted July 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

but unicode of ; was nt given

- vicky July 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

can be printed using ASCII value for semicolon.

If u don't remember the ASCII value of semicolon then write a program to find it.Its just 3 line of code:

int ch;
for(ch=1;ch<=256;ch++)
printf("%d \t %c \n",ch,ch);

which I think would not be tough.

- KK July 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@kk it was written test.. how can i find value of semi colon on paper.

- vicky July 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Then nothing could be done if u had not remember it...

- KK July 29, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

int main()
{
if(int var=59)
if(printf("%c",var))
{
}
}

- Dr, Sudarshan July 29, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think we have to access the text segment in the runtime and print the ";" in that segment.

- Anonymous July 29, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

i guess you can use the ascii values to print ';' which i my case is 59, here is the code to find it.

int i;
for(i=0; i< 255; i++)
printf(" %c-%d", i, i);

- raja August 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Using the ASCII value of the semicolon, print it as a char.

- Wolverine September 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 3 vote

main()
{
if(printf(";"))
}

- varun July 29, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Sorry it could be as follow

main()
{

if(printf(";\n"))
{}

}

- Krishna October 03, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

This one is absolutely correct....why to go for ASCII and increase complications when we can directly do it...:)

- Pankaj December 14, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

hello
i had tried this code what it not worked
showing error like this
$ gcc a.c
a.c:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
pl solve my problem

- kusum kushwaha September 30, 2012 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

#include<stdio.h>
main()
{
if(printf(;))
{}
}

- varun July 29, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

#include<stdio.h>
main()
{
if(printf(";"))
{}
}

- varun July 29, 2011 | Flag Reply


Add a Comment
Name:

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

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

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