adplus-dvertising

Welcome to the Library Functions MCQs Page

Dive deep into the fascinating world of Library Functions with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Library Functions, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Library Functions, 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 Library Functions. 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 Library Functions. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Library Functions MCQs | Page 8 of 13

Q71.
What will be the output of the program?
#include<stdio.h>

int main()
{
    typedef int arr[5];
    arr iarr = {1, 2, 3, 4, 5};
    int i;
    for(i=0; i<4; i++)
        printf("%d,", iarr[i]);
    return 0;
}
Discuss
Answer: (a).1, 2, 3, 4
Q72.
What will be the output of the program?
#include<stdio.h>

int main()
{
    typedef int LONG;
    LONG a=4;
    LONG b=68;
    float c=0;
    c=b;
    b+=a;
    printf("%d,", b);
    printf("%f\n", c);
    return 0;
}
Discuss
Answer: (a).72, 68.000000
Q73.
What will be the output of the program?
#include<stdio.h>

int main()
{
    typedef float f;
    static f *fptr;
    float fval = 90;
    fptr = &fval;
    printf("%f\n", *fptr);
    return 0;
}
Discuss
Answer: (c).90.000000
Q74.
What will be the output of the program?
#include<stdio.h>

typedef struct error {int warning, err, exception;} ERROR;
int main()
{
    ERROR e;
    e.err=1;
    printf("%d\n", e.err);
    return 0;
}
Discuss
Answer: (b).1
Q75.
In the following code snippet can we declare a new typedef named ptr even though struct employee has not been completely declared while using typedef?
typedef struct employee *ptr;
struct employee
{
    char name[20];
    int age;
    ptr next;
}
Discuss
Answer: (a).Yes
Q76.
Point out the error in the following code?
typedef struct
{
    int data;
    NODEPTR link;
}*NODEPTR;
Discuss
Answer: (b).Error: typedef cannot be used until it is defined
Q77.
Which header file should be included to use functions like malloc() and calloc()?
Discuss
Answer: (b).stdlib.h
Q78.
What function should be used to free the memory allocated by calloc() ?
Discuss
Answer: (c).free();
Q79.
How will you free the memory allocated by the following program?
#include<stdio.h>
#include<stdlib.h>
#define MAXROW 3
#define MAXCOL 4

int main()
{
    int **p, i, j;
    p = (int **) malloc(MAXROW * sizeof(int*));
    return 0;
}
Discuss
Answer: (d).free(p);
Q80.
Specify the 2 library functions to dynamically allocate memory?
Discuss
Answer: (c).malloc() and calloc()

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!