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 4 of 13

Explore more Topics under C Programming

Q31.
Find the output of the following program.
#define INC(X) X++
void main()
{
   int x=4;
   printf("%d", INC(x++));
}
Discuss
Answer: (d).Error
Q32.
In which header file is the NULL macro defined ?
Discuss
Answer: (a).stdio.h and stddef.h
Q33.
Which of the following function is correct that finds the length of a string?
A.

int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
    {    length++; s++; }
    return (length);
}

B.	

int xstrlen(char s)
{
    int length=0;
    while(*s!='\0')
        length++; s++;
    return (length);
}

C.	

int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        length++;
    return (length);
}

D.	

int xstrlen(char *s)
{
    int length=0;
    while(*s!='\0')
        s++;
    return (length);
}

a.

A

b.

B

c.

C

d.

D

Discuss
Answer: (a).A
Q34.
Which standard library function will you use to find the last occurance of a character in a string in C?
Discuss
Answer: (d).strrchr()
Discuss
Answer: (a).flushes all streams and specified streams.
Q36.
Can you use the fprintf() to display the output on the screen?
Discuss
Answer: (a).Yes
Q37.
What will be the output of the program?
#include<stdio.h>

int main()
{
    int i;
    i = printf("How r u\n");
    i = printf("%d\n", i);
    printf("%d\n", i);
    return 0;
}
Discuss
Answer: (b).How r u82
Q38.
What will be the output of the program?
#include<stdio.h>
#include<math.h>

int main()
{
    float i = 2.5;
    printf("%f, %d", floor(i), ceil(i));
    return 0;
}
Discuss
Answer: (c).2.000000, 0
Q39.
What will be the output of the program?
#include<stdio.h>

int main()
{
    int i;
    i = scanf("%d %d", &i, &i);
    printf("%d\n", i);
    return 0;
}
Discuss
Answer: (b).2
Q40.
What will be the output of the program?
#include<stdio.h>

int main()
{
    int i;
    char c;
    for(i=1; i<=5; i++)
    {
        scanf("%c", &c); /* given input is 'b' */
        ungetc(c, stdout);
        printf("%c", c);
        ungetc(c, stdin);
    }
    return 0;
}
Discuss
Answer: (c).b

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!