Question 1 of 25
Hints left: 3
Q1
Which access specifier is used where one wants data members to be accessed by other classes but not from outside objects?
Q2
If i1 is Input Iterator and i2 is Output Iterator, then which of the following things are correct? i) cout<<*i1; ii) i2 can be used with == operator iii) *i1 = 1 iv) i2--
Q3
How many parameters does a operator() in a function object shoud take?
Q4
Identify the incorrect statement.
Q5
How many types of templates are there in c++?
Q6
What is the use of includes function in c++?
Q7
Which of the following is correct about remove_all_extents() function?
Q8
Which type of heap is implemented in STL heap?
Q9
Which of the following queue container can expand or shrink from both directions?
Q10
What will be the output of the following C++ code? #include <cstdlib> #include <iostream> using namespace std; int main() { cout << RAND_MAX << endl; }
Q11
What will be the output of the following C++ code? #include <iostream> #include <cctype> using namespace std; int main(int argc, char const *argv[]) { char arr[12] = "H3ll0\tW0r1d"; for(int i=0;i<12;i++) { cout<<(bool)iscntrl(arr[i]); } }
Q12
How one can restrict a function to throw particular exceptions only?
Q13
Which of the following is the correct syntax of using pair p?
Q14
What is meant by container ship?
Q15
To what kind of elements does non-modifying sequence algorithm can be applied?
Q16
What are the operators available in C++ for dynamic allocation and de-allocation of memories?
Q17
Which classes can have vtable?
Q18
What will be the output of the following C++ code? #include <stdio.h> int main () { int n; FILE * p; char buffer [5]; p = fopen ("myfile.txt", "w+"); for ( n = 'A' ; n <= 'D' ; n++) fputc ( n, p); rewind (p); fread (buffer, 1, 5, p); fclose (p); buffer[3] = '\0'; puts (buffer); return 0; }
Q19
From where does the template class derived?
Q20
What is sequence container arrays?
Q21
What will be the output of the following C++ code? #include <iostream> #include <complex> using namespace std; int main() { complex <double> cn(3.0, 4.0); cout<<"Norm is: "<<norm(cn)<<endl; return 0; }
Q22
What will be the output of the following C++ code? #include <iostream> #include <bitset> using namespace std; int main() { bitset<8> b1(95); bitset<8> b2(46); cout<<(b1^b2); }
Q23
What will be the output of the following C++ code? #include <iostream> using namespace std; class Cat { public: int age; int weight; }; int main() { Cat f; f.age = 56; cout << "Gates is " ; cout << f.age << " years old.\n"; }
Q24
Which function is used to position back from the end of file object?
Q25
What will be the output of the following C++ code? #include <iostream> #include <functional> #include <algorithm> using namespace std; int main () { int numbers[] = {10, -20, -30, 40, -50}; int cx; cx = count_if ( numbers, numbers + 5, bind2nd(less<int>(), 0) ); cout << cx; return 0; }