Assuming a integer 2-bytes, What will be the output of the program?
#include
int main()
{
printf("%x\n", -1<<3>
Answer: B
No answer description available for this question.
Enter details here
In which numbering system can the binary number 1011011111000101 be easily converted to?
Answer: B
No answer description available for this question.
Enter details here
Which of the following statements are correct about the program?
#include
char *fun(unsigned int num, int base);
int main()
{
char *s;
s=fun(128, 2);
s=fun(128, 16);
printf("%s\n",s);
return 0;
}
char *fun(unsigned int num, int base)
{
static char buff[33];
char *ptr = &buff[sizeof(buff)-1];
*ptr = '\0';
do
{
*--ptr = "0123456789abcdef"[num ?se];
num /=base;
}while(num!=0);
return ptr;
}
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
int main()
{
if (7 & 8)
printf("Honesty");
if ((~7 & 0x000f) == 8)
printf("is the best policy\n");
}
Answer: C
No answer description available for this question.
Enter details here
Bitwise can be used to perform addition and subtraction.
Answer: B
No answer description available for this question.
Enter details here
Which statement is suitable to check 3rd (count from 0) bit is high (set) or not?
Answer: D
No answer description available for this question.
Enter details here
On left shifting, the bits from the left are rotated and brought to the right and accommodated where there is empty space on the right?
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
void main()
{
int x = 4;
int *p = &x;
int *k = p++;
int r = p - k;
printf("%d", r);
}
Answer: C
No answer description available for this question.
Enter details here
Predict the output of following program.
#include
int main()
{
int x=10;
x &= ~2;
printf("x= %d",x);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Bitwise & can be used in conjunction with ~ operator to turn off 1 or more bits in a number.
Answer: A
No answer description available for this question.
Enter details here