PHP Operator and Expression MCQ Questions and Answers

PHP Operator and Expression MCQ Questions and Answers

Home | PHP | Operator And Expression

PHP Operator and Expression MCQ Questions and Answers: We are providing operator and expression question of PHP, where you can learn and practice.

Page: 1/2

1) Which of the following operator takes only integer operands?

2) Determine output:

void main()
{
int i=0, j=1, k=2, m;
m = i++ || j++ || k++;
printf("%d %d %d %d", m, i, j, k);
}

3) Determine output:

void main()
{
int c = - -2;
printf("c=%d", c);
}

4) Determine output:

void main()
{
int i=10;
i = !i>14;
printf("i=%d", i);
}

5) In C programming language, which of the following type of operators have the highest precedence

6) What will be the output of the following program?

void main()
{
int a, b, c, d;
a = 3;
b = 5;
c = a, b;
d = (a, b);
printf("c=%d d=%d", c, d);
}

7) Which of the following comments about the ++ operator are correct?

8) What will be the output of this program on an implementation where int occupies 2 bytes?

#include 
void main()
{
int i = 3;
int j;
j = sizeof(++i + ++i);
printf("i=%d j=%d", i, j);
}

9) Which operator has the lowest priority?

10) What will be the output?

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

Download MCQ PDF