ExamVeda
Login
Home
71
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
#include <cstdlib>
#include <exception>
void Funct()
{
    cout << "Funct() was called by terminate()." << endl;
    exit(0);
}
int main()
{
    try
    {
        set_terminate(Funct);
        throw "Out of memory!";
   }
    catch(int)
    { 
        cout << "Integer exception raised." << endl; 
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
72
What can be used to input a string with blank space?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
73
Which is dependant on template parameter?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
74
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
    double Op1 = 10, Op2 = 5, Res;
    char Op;
    try 
    {   
        if (Op != '+' && Op != '-' && Op != '*' && Op != '/')
            throw Op;
        switch(Op)
        {
        case '+':
            Res = Op1 + Op2;
            break;
        case '-':
            Res = Op1 - Op2;
            break;
        case '*':
            Res = Op1 * Op2;
            break;
        case '/':
            Res = Op1 / Op2;
            break;
         }
         cout << "\n" << Op1 << " " << Op << " "<< Op2 << " = " << Res;
     }
     catch (const char n)
     {
         cout << n << " is not a valid operator";
     }
     return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
75
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
	cout<<rank<remove_all_extents<string[10][20]>::type>::value;
	return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
76
Which classes are called as mixin?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
77
Which is used to handle the exceptions in c++?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
78
What will be the output of the following C++ code?
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main ()
{
    char str[] = "ffff";
    long int number;
    if (isxdigit(str[0]))
    {
        number = strtol (str, NULL, 16);
        printf ("%ld\n", number);
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
79
Which header file is used for reading and writing to a file?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
80
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:
	A(){
		cout<<"Created\n";
	}
	~A(){
		cout<<"Destroyed\n";
	}
};
 
int main(int argc, char const *argv[])
{
	A a;
	return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board