81.
What will be the output of the following C++ code?
#include <iostream>
#include <iterator>
using namespace std;
int main ()
{
    try {
        double value1, value2;
        istream_iterator<double> eos;       
        istream_iterator<double> iit (cin);   
        if (iit != eos) 
            value1 = *iit;
        iit++;
        if (iit != eos) 
            value2 = *iit;
        cout << (value1 * value2) << endl;
    }
    catch (...) {
        cout << "Unknown exception: " << endl;
    }
    return 0;
}

84.
What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
template<class T>
class A
{
    public:
	T func(T a, T b){
		return a/b;
	}	
};
 
int main(int argc, char const *argv[])
{
	A <int>a1;
	cout<<a1.func(3,2)<<endl;
	cout<<a1.func(3.0,2.0)<<endl;
	return 0;
}

87.
What will be the output of the following C++ code?
#include <stdio.h>
int main ()
{
    FILE * p;
    int c;
    int n = 0;
    p = fopen ("myfile.txt", "r");
    if (p == NULL) 
        perror ("Error opening file");
    else
    {
        do {
            c = getc (p);
            if (c == '$') 
                n++;
        } while (c != EOF);
        fclose (p);
        printf ("%d\n", n);
    }
    return 0;
}

89.
What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool myfunction (int i,int j) { return (i<j); }
int main () 
{
    int myints[] = {9, 8, 7, 6, 5};
    vector<int> myvector (myints, myints + 5);
    partial_sort (myvector.begin(), myvector.begin() + 3, myvector.end());
    partial_sort (myvector.begin(), myvector.begin() + 2, myvector.end(), 
    myfunction);
    for (vector<int> :: iterator it = myvector.begin(); it != myvector.end(); ++it)
        cout << ' ' << *it;
    return 0;
}