Showing posts with label MNCs. Show all posts
Showing posts with label MNCs. Show all posts

Thursday, 7 February 2013

Infosys Campus Interviews Previous Questions

1. Father's age is three years more than three times the son's age.  After three years, father's age will be ten years more than twice the son's age.  What is the father's present age.

Ans: 33 years.                



2. Find the values of each of the alphabets.


N O O N
S O O N
+ M O O N
----------
J U N E

Ans:

Sunday, 16 December 2012

List five responsibilities of a database management system.

Q) List five responsibilities of a database management system. For each responsibility, explain the problems that would arise if the responsibility were not discharged.

Answer: A general purpose database manager (DBM) has five responsibilities:

a. interaction with the file manager.


b. integrity enforcement.


c. security enforcement.


d. backup and recovery.


e. concurrency control.


If these responsibilities were not met by a given DBM

Tuesday, 28 August 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 15

Predict the output or error(s) for the following:


1)

main()

{

int i=_l_abc(10);


printf("%d\n",--i);


}

int _l_abc(int i)

{

 return(i++);


}

Answer:

9


Explanation:

Monday, 12 March 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 14

Predict the output or error(s) for the following:


1)

struct point

{

 int x;


 int y;


 };

struct point origin,*pp;

main()

{

pp=&origin;


printf("origin is(%d%d)\n",(*pp).x,(*pp).y);


printf("origin is (%d%d)\n",pp->x,pp->y);


}

Answer:

origin is(0,0)


origin is(0,0)


Explanation:

Tuesday, 6 March 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 13

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

  int a[2][2][2] = { {10,2,3,4}, {5,6,7,8}  };


  int *p,*q;


  p=&a[2][2][2];


  *q=***a;


  printf("%d..%d",*p,*q);


}

Answer:

garbagevalue..1


Explanation:

Thursday, 1 March 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 12

Predict the output or error(s) for the following:


1)

int i=10;

main()

{

extern int i;


{


int i=20;


{


const volatile unsigned i=30;


printf("%d",i);


}


printf("%d",i);


}


printf("%d",i);


}

Answer:

30,20,10


Explanation:

Monday, 20 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 10

Predict the output or error(s) for the following:


1)

main()

{

char *str1="abcd";


char str2[]="abcd";


printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));


}

Answer:

2 5 5


Explanation:

Tuesday, 14 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 9

Predict the output or error(s) for the following:


1)

main()

{

char *cptr,c;


void *vptr,v;


c=10;  v=0;


cptr=&c; vptr=&v;


printf("%c%v",c,v);


}

Answer:

Compiler error (at line number 4): size of v is Unknown.


Explanation:

Thursday, 9 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 8

Predict the output or error(s) for the following:


1)

int i,j;

for(i=0;i<=10;i++)

{

j+=5;


assert(i<5);


}

Answer:

Runtime error: Abnormal program termination.


assert failed (i<5), <file name>,<line number>


Explanation:

Saturday, 4 February 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 7

Predict the output or error(s) for the following:


1)

main ( )

{

 static char *s[ ]  = {“black”, “white”, “yellow”, “violet”};


 char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;


 p = ptr;


 **++p;


 printf(“%s”,*--*++p + 3);


}

Answer:

ck


Explanation:

Sunday, 29 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 6

Predict the output or error(s) for the following:


1)

main( )

{

 void *vp;


 char ch = ‘g’, *cp = “goofy”;


 int j = 20;


 vp = &ch;


 printf(“%c”, *(char *)vp);


 vp = &j;


 printf(“%d”,*(int *)vp);


 vp = cp;


 printf(“%s”,(char *)vp + 3);


}

Answer:

g20fy


Explanation:

Tuesday, 24 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 5

Predict the output or error(s) for the following:


1)

main( )

{

 static int  a[ ]   = {0,1,2,3,4};


 int  *p[ ] = {a,a+1,a+2,a+3,a+4};


 int  **ptr =  p;


 ptr++;


 printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


 *ptr++;


 printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


 *++ptr;


 printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


 ++*ptr;


printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr);


}

Answer:

111


222


333


344


Explanation:

Thursday, 19 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 4

Predict the output or error(s) for the following:


1)

main( )

{

int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}};


printf(“%u %u %u %d \n”,a,*a,**a,***a);


printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1);


}

Answer:

100, 100, 100, 2


114, 104, 102, 3


Explanation:

Saturday, 7 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 2

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

  char s[]={'a','b','c','\n','c','\0'};


  char *p,*str,*str1;


  p=&s[3];


  str=p;


  str1=s;


  printf("%d",++*p + ++*str1-32);


}

Answer:

M


Explanation:

Monday, 2 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc - 1

Predict the output or error(s) for the following:


1)

main()

{

static char names[5][20]={"pascal","ada","cobol","fortran","perl"};


int i;


char *t;


t=names[3];


names[3]=names[4];


names[4]=t;


for (i=0;i<=4;i++)


printf("%s",names[i]);


}

Answer:

Compiler error: Lvalue required in function main


Explanation:

Wednesday, 28 December 2011

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc

Predict the output or error(s) for the following:


1)

main()

{

int i=1;


while (i<=5)


{


printf("%d",i);


if (i>2)


goto here;


i++;


}


}

fun()

{

here:


    printf("PP");


}

Answer:

Compiler error: Undefined label 'here' in function main


Explanation: