C++ Interview Questions - Amazon

1. What is the output of the program?

main()
{
int c=5;
cout<< “\n\n”<> 2);
}

a) 5 b) 7 c) 3 d) None of the above

2. What is the output of the program?

main()
{
int a[8][10],c=0,i,j;
for(i=0;i<10;i++)
for(j=0;j<8;j++)
a[j][i]=c++;
cout<< a[3][6];
}

a) 3 6 b) 8 9 c) 7 6 d) None of the above

3. Find the error in this program?

main()
{
char *p,*q;
p=(char *)malloc(25);
q=(char*) malloc(25);
strcpy(p,"amazon" );
strcpy(q,"hyd");
strcat(p,q);
cout<}

a) amazonhyd b) amzon c) hyd d) None
4. Convert the expression into prefix and postfix notations

(a+b)*c-(d+e)^(f-g)

5. What is the output of the program?

main()
{
int i=5;
cout<}
void fun (int i)
{ if(i%2) return (i+(7*4)-(5/2)+(2*2));
else return (i+(17/5)-(34/15)+(5/2));
}
Post your comment

    Discussion

  • RE: C++ Interview Questions - Amazon -Kevin (06/01/18)
  • Hi There,

    In total awe…. So much respect and gratitude to you folks for C++ Interview Questions - Amazon without missing any points on the Distributed vs Parallel computing. Kudos!

    I know that you may answer as already in such case that you noticed that I open case 4914182641 in support center and that I need to wait their answer. But when I opened it, I start to search such problems with overdue payments on forums. And I found that everytime people said that they not get answer from support (from 48 hours to 1 week). I'm very affraid that in my case support cannot react same as I read it from forums. And that my account can be closed. It's really little sum (approx. 8 EUR for february) and very big time of use (many years). I create domain's there and buckets. And it's very affraid to lost account such way. Can you, please, help me?

    Amazon S3 provides access to reliable and inexpensive data storage infrastructure. It is designed to make web-scale computing easier by enabling you to store and retrieve any amount of data, at any time, from within Amazon EC2 or anywhere on the web.

    But nice Article Mate! Great Information! Keep up the good work!

    Kind Regards,
    Kevin
  • RE: C++ Interview Questions - Amazon -Interview Questions (02/03/12)
  • C++ interview questions and answers
    C interview questions and answers
    Oracle interview questions and answers
    Cloud Computing interview questions and answers
    Networking interview questions and answers
    Java interview questions and answers