My Report

C Programming Mock Test 8


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. Which among the following is never possible in C when members in a structure are the same as that in a union?

   //Let P be a structure
   //Let Q be a union

Question 1 of 10

Question 2 of 10

2. Point out the error( if any) in the following code.

#include<stdio.h>
enum sanfoundry
{
    a,b,c
};
enum sanfoundry g;
main()
{
    g++;
    printf("%d",g);
}

Question 2 of 10

Question 3 of 10

3. What will be the output of the following C code?

    #include <stdio.h>
    printf("%.0f", 2.89);
    

Question 3 of 10

Question 4 of 10

4. What will be the output of the following C code if the code is executed on a 32 bit platform?

#include <stdio.h>
enum sanfoundry
 {
    c = 0,
    d = 10,
    h = 20,
    s = 3
} a;

int main()
{
        a = c;
	printf("Size of enum variable = %d bytes", sizeof(a));
	return 0;
}

Question 4 of 10

Question 5 of 10

5. What is the sizeof(char) in a 32-bit C compiler?

Question 5 of 10

Question 6 of 10

6. There are two groups of string functions defined in the header <string.h>. What are they?

Question 6 of 10

Question 7 of 10

7. One of the major difference between typedef and #define is that typedef interpretation is performed by the _________________ whereas #define interpretation is performed by the _____________

Question 7 of 10

Question 8 of 10

8. The______function tests for any character for which isalpha or isdigit is true.

Question 8 of 10

Question 9 of 10

9. This function checks whether the passed character is white-space.

Question 9 of 10

Question 10 of 10

10. A user defined data type, which is used to assign names to integral constants is called ____________

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.