My Report

C Dynamic Memory Allocation Test – 3


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

1. The preprocessor directive used to give additional information to the compiler, beyond which is conveyed in the language _____________

2. In the directive, #pragma pack(n), which of the following is not a valid value of n?

3. The correct syntax of the attribute packed is _________

4. In the directive #pragma pack(n), if the value of ā€˜nā€™ is given to be 5, then what happens?

5. #pragma GCC poison should be followed by a list of identifiers that are _________

6. The pragma ___________________ is used to remove an identifier completely from a program.

7. The function of __attribute__((packed)); can also be performed using _________

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

#include<stdio.h>
#pragma GCC poison printf
main()
{
    printf("sanfoundry");
    return 0;
}

9. What will be the output of the following C code, if it is run on a 32 bit platform?

#include<stdio.h>
#pragma(1)
struct test
{
    int i;
    char j;
};
main()
{
    printf("%d",sizeof(struct test));
}

10. Which of the following attributes is used to specify that the minimum required memory to be used to represent the types?


 

Start practicing “1000 MCQs on C”, and once you are ready, you can take tests on all topics by attempting our “C Test Series”.

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.