Operators
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int p = 5, q = 4;
p *= p + q;
printf("%d\n", p);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
45
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int p = 4, q = 4;
p /= p / q;
printf("%d\n", p);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
4
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int p = 2, q = 1;
p &&= q;
printf("%d\n", p);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Compilation Error
main.c: In function ‘main’:
main.c:5:13: error: expected expression before ‘=’ token
p &&= q;
- Operation “n = n * m + n” can also be written as ___________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Operation “n = n * m + n” can also be written as "(p = n * m)!=(n = p + m);" or n = (m + 1)* n; and n *= m + 1;
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int p = 3, q = 4;
p += q -= p;
printf("%d %d", p, q);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
4 1