Logo

C-and-c- Questions Set 5:

Quiz Mode

What will be the output of the following C++ code?

1
2
3
4

Solution:

Calculate 10110111 - 00110010 using the two's complement method.

1
2
3
4

Solution:

 Which of the following type-casting have chances for wrap around? 

1
2
3
4

Solution:

What will be the output of the following C program?


#include<stdio.h>

void main()

{

    int a = 10;

    printf("%d",a>100);

}


1
2
3
4

Solution:

Which access specifier makes all the data members and functions of the base class inaccessible by the derived class?

1
2
3
4

Solution:

What will be the output of the following C code?

int main()

{

    int a = 320;

    char *ptr;

    ptr = (char *)&a;

    printf("%d", *ptr);

    return 0;

}

1
2
3
4

Solution:

Pick out the correct syntax of the header file that can be used with C++. 

1
2
3
4

Solution:

  What is the output of this C code?

 int *i;
  int main()
    {
 if (i == NULL)
            printf("true\n");
 return 0;
    } 

1
2
3

Solution:

What is the output of the following C program?


#include <stdio.h>

int main()

{

printf("%p", main);

return 0;

}


1
2
3
4

Solution:

What is a static function in C?

1
2
3
4

Solution: