suresh reddy


{ City } bangalore
< Country > india
* Profession * student
User No # 6298
Total Questions Posted # 0
Total Answers Posted # 6

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 36
Users Marked my Answers as Wrong # 30
Questions / { suresh reddy }
Questions Answers Category Views Company eMail




Answers / { suresh reddy }

Question { TCS, 18119 }

what does the following function print?
func(int i)
{
if(i%2)return 0;
eale return 1;
}
main()
{
int =3;
i=func(i);
i=func(i);
printf("%d",i);}


Answer

Answer is 3

Is This Answer Correct ?    1 Yes 10 No

Question { Ramco, 15493 }

main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}

what is the output?


Answer

Ans:

5 20 1

Is This Answer Correct ?    18 Yes 4 No


Question { ME, 23084 }

main()
{
int i=400,j=300;
printf("%d..%d");
}


Answer

Answer:

400 300

printf takes first two intilization values as default

Is This Answer Correct ?    2 Yes 9 No

Question { ME, 17808 }

void main()
{
int i=5;
printf("%d",i+++++i);
}


Answer

Error

Is This Answer Correct ?    2 Yes 1 No

Question { ME, 17216 }

#include
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}


Answer

Compiler Error: Constant expression required in function
main

instead of using j u we can use case 'j' .

this is correct answer

Is This Answer Correct ?    5 Yes 5 No

Question { RMSI, 19230 }

how does the for loop work actually..suppose for the
following program how it ll work plz explain to me
for(i=5;i>=0;i--)
prinf(i--);


Answer

The correct answer is

5
3
1

because

in for loop "i--" statement is there and again in printf
statement "i--" is there.

Is This Answer Correct ?    8 Yes 1 No