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

Explore more Topics under C Programming

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

int main()
{
    char *i = "55.555";
    int result1 = 10;
    float result2 = 11.111;
    result1 = result1+atoi(i);
    result2 = result2+atof(i);
    printf("%d, %f", result1, result2);
    return 0;
}
Discuss
Answer: (c).65, 66.666000
Q12.
What will be the output of the program?
#include<stdio.h>
#include<string.h>

int main()
{
    char dest[] = {97, 97, 0};
    char src[] = "aaa";
    int i;
    if((i = memcmp(dest, src, 2))==0)
        printf("Got it");
    else
        printf("Missed");
    return 0;
}
Discuss
Answer: (b).Got it
Discuss
Answer: (b).Convert floating-point number to a string
Q14.
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 'a' */
        printf("%c", c);
        ungetc(c, stdin);
    }
    return 0;
}
Discuss
Answer: (b).aaaaa
Q15.
Point out the error in the following program.
#include<stdio.h>

int main()
{
    fprintf("Compscibits");
    printf("%.ef", 2.0);
    return 0;
}
Discuss
Answer: (b).Error: in fprintf() statement
Q16.
Point out the error in the following program.
#include<stdio.h>
#include<string.h>

int main()
{
    char str1[] = "Learn through Compscibits\0.com",  str2[120];
    char *p;
    p = (char*) memccpy(str2, str1, 'i', strlen(str1));
    *p = '\0';
    printf("%s", str2);
    return 0;
}
Discuss
Answer: (d).No error and prints "Learn through Comp"
Q17.
Point out the error in the following program.
#include<stdio.h>

int main()
{
    char str[] = "IndiaBIX";
    printf("%.#s %2s", str, str);
    return 0;
}
Discuss
Answer: (d).No error
Q18.
Determine Output:
#include<stdio.h>
#define a 10
void main()
{
      #define a 50
      printf("%d", a);
}
Discuss
Answer: (a).50
Discuss
Answer: (d).All of the above
Discuss
Answer: (c).has # as the first character

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!