Showing posts with label Precedence. Show all posts
Showing posts with label Precedence. Show all posts

Wednesday, February 10, 2010

What number will z in the sample code contain?

int z,x=5,y=-10,a=4,b=2;
z = x++ - --y * b / a;

a) 5
b) 6
c) 10
d) 11
e) 12

Monday, June 8, 2009

What is the output of following programme ?

main()
{
int a=2,*f1,*f2;
f1=f2=&a;
*f2+=*f2+=a+=2.5;
*f1+=*f1+=a+=2.5;
printf("\n%d %d %d",a,*f1,*f2);
}

Choice
a) 18,18,18
b) 10,10,10
c) 72,72,72
d) 64,64,64
e) 26,26,26

Wednesday, May 27, 2009

What is the output of following programme ?

int main()
{
int x=10;
printf("%d",++x+x++<x+++x++);
return 0;
}

a. Error
b. 1
c. 24
d. 0
e. 46

Tuesday, May 12, 2009

1. When the function below is called with a pointer to an open file that contains only three characters A, B and C which one of the following is printed

void listFile( FILE * fp )

{
int c;

while( c = fgetc(fp) != EOF )

{

printf(“%d”, c);

}

printf(“\n”);

}


a. ABC1

b. 1111

c. The characters AB followed by an infinite number of C characters

d. 6566671

e. 0001

Thursday, January 1, 2009

An expression contains relational, assignment and arithmetic operators. If Parenthesis are not present, the order will be

a. Assignment, arithmetic, relational
b. Relational, arithmetic, assignment
c. Assignment, relational, arithmetic
d. Arithmetic, relational, assignment

Wednesday, October 15, 2008

What is the output?

void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf("EXAM");
}
}

a) XAM is printed
b) EXAM is printed
c) Compiler Error
d) Nothing is printed

Monday, October 13, 2008

What will be the o/p of the below program

float i=5, j;

j = ++i/--i/--i*i;

printf(“%f\n”, j);

Choice

a) 0.75
b) 1.25
c) 1.2
d) 0.075
e) 1.000000