Subscribe:Posts Comments | Read Articles on Various Topics - Pro Articles

You Are Here: Home » Sample Placement Papers, Wipro Test Papers » Wipro Placement Paper – Program error & output questions

Wipro Placement Papers Programs find output or errors.
Can also be asked in some technical / tech interviews.
C Language Questions: Find the output or check out the errors in the program code.

1)main()
{
char a[2];
*a[0]=7;
*a[1]=5;
printf(“%d”,&a[1]-a)
ANS:
ans may be 1.(illegal initialization)
2)
#include
main(){
char a[]=”hellow”;
char *b=”hellow”;
char c[5]=”hellow”;
printf(“%s %s %s “,a,b,c);
printf(” “,sizeof(a),sizeof(b),sizeof(c));
}
(ans is hellow,hellow,hellow
6,2,5 )
3)
#include
main()

float value=10.00;
printf(“%g %0.2g %0.4g %f”,value,value,value,value)
}
(ans is 10,10,10,10.000000)
4)
#include
void function1;
int i-value=100;
main()
{
i-value=50;
function1;
printf(“i-value in the function=”,i-value);
printf(“i-value after the function=”,i-value);
}
printf(“i-value at the end of main=”,i-value);
functioni()
i-value=25;
THIS IS ROUGH IDEA OF THE PROGRAM
ANS ARE
1)i-value in the function=25;
2)i-value after the function=50;
3)i-value at the end of the main=100;

5)
main()
{
funct(int n);
{
switch(n)
case1:
m=2;
break;
case2:
m=5;
break;
case3:
m=7;
break;
default:
m=0;
}
THIS IS ROUGH IDEA:
(ANS:Out put is m=0)

Wipro IT Graduates, C and C++ Skills checking program output / error finding programming questions from IT MNC latest 2008 Placement Sample Test Papers.

Related Posts
Tags:

Leave a Reply

© Copyright 2010 Latestexams. All Rights Reserved | Privacy Policy | Terms & Conditions