adplus-dvertising

Welcome to the Strings,Streams and Numerics in C++ MCQs Page

Dive deep into the fascinating world of Strings,Streams and Numerics in C++ with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Strings,Streams and Numerics in C++, a crucial aspect of Object Oriented Programming Using C++. In this section, you will encounter a diverse range of MCQs that cover various aspects of Strings,Streams and Numerics 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 Object Oriented Programming Using C++.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Strings,Streams and Numerics in C++. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Object Oriented Programming Using C++.

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

Strings,Streams and Numerics in C++ MCQs | Page 5 of 21

Q41.
How many parameters can a resize method take?
Discuss
Answer: (c).1 or 2
Q42.
Where are standard C libraries defined in C++?
Discuss
Answer: (b).std namespace
Q43.
Which of the following have their changes in their declaration related to constness of parameter?
Discuss
Answer: (a).strchr
Q44.
How many elements does a floating point number is composed of?

a.

1

b.

2

c.

3

d.

4

Discuss
Answer: (d).4
Q45.
What is the output of this program?
    #include <stdio.h>    
    #include <stdlib.h>
    int main ()
    {
        char s[] = "365.24 29.53";
        char* p;
        double d1, d2;
        d1 = strtod (s, &p);
        d2 = strtod (p, NULL);
        printf ("%.2f\n", d1/d2);
        return 0;
    }
Discuss
Answer: (b).12.37
Q46.
What is the output of this program?
    #include <stdio.h>
    #include <stdlib.h>
    int compareints (const void * a, const void * b)
    {
        return ( *(int*)a - *(int*)b );
    }
    int values[] = { 50, 20, 60, 40, 10, 30 };
    int main ()
    {
        int * p;
        int key = 40;
        qsort(values, 6, sizeof (int), compareints);
        p = (int*) bsearch (&key, values, 6, sizeof (int), compareints);
        if (p != NULL)
        printf ("%d\n",*p);
        return 0;
    }
Discuss
Answer: (c).40
Q47.
What is the output of this program?
    #include <stdio.h>    
    #include <stdlib.h>   
    int main ()
    {
        int n, m;
        n = abs(23);
        m = abs(-11);
        printf ("%d", n);
        printf ("%d", m);
        return 0;
    }
Discuss
Answer: (c).2311
Q48.
What is the output of this program?
    #include <stdio.h>
    #include <math.h>
    int main ()
    {
        printf ("The value of -3.1416 is %lf\n", fabs (-3.1416));
        return 0;
    }
Discuss
Answer: (d).3.141600
Q49.
What is the output of this program?
    #include <stdio.h>
    #include <stdlib.h>
    int main ()
    {
        div_t divresult;
 
        divresult = div (38, 5);
        printf ("%d\n", divresult.rem);
        return 0;
    }
Discuss
Answer: (b).3
Q50.
How does the limits.h header file can be represented in C++?
Discuss
Answer: (c).climits
Page 5 of 21

Suggested Topics

Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? 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!