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

Q51.
What will be the output of the program?
#include<stdio.h>
#define SQR(x)(x*x)

int main()
{
    int a, b=3;
    a = SQR(b+2);
    printf("%d\n", a);
    return 0;
}
Discuss
Answer: (b).11
Q52.
What will be the output of the program?
#include<stdio.h>
#define JOIN(s1, s2) printf("%s=%s %s=%s \n", #s1, s1, #s2, s2);
int main()
{
    char *str1="CompSci";
    char *str2="Bits";
    JOIN(str1, str2);
    return 0;
}
Discuss
Answer: (b).str1=CompSci str2=Bits
Q53.
What will be the output of the program?
#include<stdio.h>
#define CUBE(x) (x*x*x)

int main()
{
    int a, b=3;
    a = CUBE(b++);
    printf("%d, %d\n", a, b);
    return 0;
}
Discuss
Answer: (c).27, 6
Q54.
What will be the output of the program?
#include<stdio.h>
#define PRINT(int) printf("int=%d, ", int);

int main()
{
    int x=2, y=3, z=4;   
    PRINT(x);
    PRINT(y);
    PRINT(z);
    return 0;
}
Discuss
Answer: (a).int=2, int=3, int=4
Q55.
What will be the output of the program?
#include<stdio.h>
#define SWAP(a, b) int t; t=a, a=b, b=t;
int main()
{
    int a=10, b=12;
    SWAP(a, b);
    printf("a = %d, b = %d\n", a, b);
    return 0;
}
Discuss
Answer: (b).a = 12, b = 10
Q56.
What will be the output of the program?
#include<stdio.h>
#define FUN(i, j) i##j

int main()
{
    int va1=10;
    int va12=20;
    printf("%d\n", FUN(va1, 2));
    return 0;
}
Discuss
Answer: (b).20
Q57.
What will be the output of the program?
#include<stdio.h>
#define MAX(a, b) (a > b ? a : b)

int main()
{
    int x;
    x = MAX(3+2, 2+7);
    printf("%d\n", x);
    return 0;
}

a.

8

b.

9

c.

6

d.

5

Discuss
Answer: (b).9
Q58.
What will be the output of the program?
#include<stdio.h>
#define MIN(x, y) (x<y)? x : y;
int main()
{
    int x=3, y=4, z;
    z = MIN(x+y/2, y-1);
    if(z > 0)
        printf("%d\n", z);
    return 0;
}
Discuss
Answer: (a).3
Q59.
What will be the output of the program?
#include<stdio.h>
#define str(x) #x
#define Xstr(x) str(x)
#define oper multiply

int main()
{
    char *opername = Xstr(oper);
    printf("%s\n", opername);
    return 0;
}
Discuss
Answer: (c).print 'multiply'
Q60.
What will be the output of the program?
#include<stdio.h>
#define MESS junk

int main()
{
    printf("MESS\n");
    return 0;
}
Discuss
Answer: (b).MESS
Page 6 of 13

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!