Operators
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n = -5;
n = n >> 2;
printf("%d\n", n);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
-2
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int num = 7;
num = num << 2;
printf("%d\n", num);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
28
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int n = -7;
int p = (n++, ++n);
printf("%d\n", p);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
-5
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int num1 = 7, num2 = -9, num3 = 3, num4;
num4 = ++num1 && ++num2 || ++num3;
printf("%d %d %d %d", num1, num2, num3, num4);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
8 -8 3 1
- What will be the output of the following C code?
#include
void main()
{
int n = 6;
int *ptr1 = &n;
int *ptr2 = ptr1++;
int Res = ptr1 - ptr2;
printf("%d", Res);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
1