adplus-dvertising

Welcome to the Input and Output in C MCQs Page

Dive deep into the fascinating world of Input and Output in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Input and Output in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Input and Output in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Input and Output in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Input and Output in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Input and Output in C MCQs | Page 16 of 42

Explore more Topics under C Programming

Q151.
On freeing a dynamic memory, if the pointer value is not modified, then the pointer points to
Discuss
Answer: (c).The same deallocated memory location
Q152.
For the following program, Which of the following should be used for freeing the memory allocated?
#include <stdio.h>
    struct p
    {
        struct p *next;
        int x;
    };
    int main()
    {
        struct p *p1 = (struct p*)malloc(sizeof(struct p));
        p1->x = 1;
        p1->next = (struct p*)malloc(sizeof(struct p));
        return 0;
    }
Discuss
Answer: (b).free(p1->next); free(p1);
Q153.
What is the output of this C code?
#include <stdio.h>
    struct p
    {
        struct p *next;
        int x;
    };
    int main()
    {
        struct p *p1 = calloc(1, sizeof(struct p));
        p1->x = 1;
        p1->next = calloc(1, sizeof(struct p));
        printf("%d\n", p1->next->x);
        return 0;
    }
Discuss
Answer: (d).0
Q154.
What is the output of this C code?
#include <stdio.h>
    struct p
    {
        struct p *next;
        int x;
    };
    int main()
    {
        struct p* p1 = malloc(sizeof(struct p));
        p1->x = 1;
        p1->next = malloc(sizeof(struct p));
        printf("%d\n", p1->next->x);
        return 0;
    }
Discuss
Answer: (c).Somegarbage value
Q155.
calloc initialises memory with all bits set to zero.
Discuss
Answer: (a).True
Discuss
Answer: (b).Free the memory pointed to by ptr
Q157.
What is the output of this C code?
#include <stdio.h>
    #include <math.h>
    int main()
    {
        int i = 90;
        printf("%f\n", sin(i));
        return 0;
    }
Discuss
Answer: (a).Compile time error
Q158.
What is the output of this C code?
#include <stdio.h>
    #include <math.h>
    int main()
    {
        unsigned int i = -1;
        printf("%f\n", fabs(i));
        return 0;
    }
Discuss
Answer: (d).None of the mentioned
Q159.
function fabs defined math.h header file takes argument of type integer
Discuss
Answer: (b).False
Discuss
Answer: (a).Natural base logarithm

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!