a) &&
b) ||
c) !
d) *
Showing posts with label Operators. Show all posts
Showing posts with label Operators. Show all posts
Wednesday, February 25, 2009
Thursday, February 5, 2009
Which one of the following operators has right to left associativity?
Choice a: Function call operator ()
Choice b: Logical not operator !
Choice c: Array index operator []
Choice d: Multiplication operator *
Choice e: Pointer operator ->
Choice b: Logical not operator !
Choice c: Array index operator []
Choice d: Multiplication operator *
Choice e: Pointer operator ->
Tuesday, December 2, 2008
What is the output of following programme ?
main()
{
int a=500, b=100, c;
if(!a>=400)
b=300; c=200;
printf("b=%d c=%d", b,c);
}
a. b=300 c=200
b. b=100 c=garbage
c. b=300 c=garbage
d. b=100 c=200
{
int a=500, b=100, c;
if(!a>=400)
b=300; c=200;
printf("b=%d c=%d", b,c);
}
a. b=300 c=200
b. b=100 c=garbage
c. b=300 c=garbage
d. b=100 c=200
Tuesday, November 18, 2008
What is the output of following programme ?
main() {
int i, x=10, y=100%90;
for(i=1;i<=10;i++) if(x!=y) printf("x=%d y=%d", x,y); } a. The printf() function is called 10 times b. The program will produce the output x=10 y=10 c. The program will not produce any output d. The printf() function is called infinite times
int i, x=10, y=100%90;
for(i=1;i<=10;i++) if(x!=y) printf("x=%d y=%d", x,y); } a. The printf() function is called 10 times b. The program will produce the output x=10 y=10 c. The program will not produce any output d. The printf() function is called infinite times
Sunday, November 2, 2008
What is the output of following programme ?
main() {
int x=10, y=20;
if(!!!!x||2&&x)
printf("x=%d", x);
else
printf("y=%d",y);
}
a. Y=20
b. X=10
c. X=-10
d. X=0
e. Error
int x=10, y=20;
if(!!!!x||2&&x)
printf("x=%d", x);
else
printf("y=%d",y);
}
a. Y=20
b. X=10
c. X=-10
d. X=0
e. Error
Tuesday, October 21, 2008
What will be printed when the sample code above is executed?
int x = 0;
for ( ; ; )
{
if (x++ == 4)
break;
continue;
}
printf("x=%d\n", x);
Choice a: x=0
Choice b: x=1
Choice c: x=4
Choice d: x=5
Choice e: x=6
for ( ; ; )
{
if (x++ == 4)
break;
continue;
}
printf("x=%d\n", x);
Choice a: x=0
Choice b: x=1
Choice c: x=4
Choice d: x=5
Choice e: x=6
Subscribe to:
Posts (Atom)