My Report

C++ Programming Practice Test 10


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What will act as a intermediate between i/o operations and physical file?

2. What will be the output of the following C++ code?

#include<iostream>
using namespace std;
int main()
{
	int a = 5;
	auto check = [](int x) 
        {
		if(x == 0)
			return false;
		else
			return true;
	};
	cout<<check(a)<<endl;
	return 0;
}

3. Choose the correct formatted code.

4. What will be the output of the following C++ code?

  
    #include <iostream>
    using namespace std;
    int main()
    {
        unsigned long x = 64;
        cout << x << oct << x << endl;
        return 0;
    }

5. What will be the output of the following C++ code?

    #include <stdio.h>
    #include <math.h>
    int main ()
    {
        printf ("%lf\n", fmod (5.3, 2) );
        printf ("%lf\n", fmod (18.5, 4.2) );
        return 0;
    }

6. Where does the member should be defined if it is used in the program?

7. What is the use of accumulate function in a numeric library?

8. What will be the output of the following C++ code?

  
    #include <iostream>
    using namespace std;
    int main( )
    {
        char line[100];
        cin.getline( line, 100, 't' );
        cout << line;
        return 0;
    }

9. How many maximum number of parameters does a string constructor can take?

10. Which will be used with physical devices to interact from C++ program?


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.