Question 1 of 25
Hints left: 3
Q1
What is sequence container arrays?
Q2
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; }
Q3
How many types of templates are there in c++?
Q4
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; }
Q5
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]); } }
Q6
Which of the following is correct about remove_all_extents() function?
Q7
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"; }
Q8
What are the operators available in C++ for dynamic allocation and de-allocation of memories?
Q9
What is the use of includes function in c++?
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 <bitset> using namespace std; int main() { bitset<8> b1(95); bitset<8> b2(46); cout<<(b1^b2); }
Q12
Which of the following queue container can expand or shrink from both directions?
Q13
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; }
Q14
Which function is used to position back from the end of file object?
Q15
How many parameters does a operator() in a function object shoud take?
Q16
Identify the incorrect statement.
Q17
Which type of heap is implemented in STL heap?
Q18
Which of the following is the correct syntax of using pair p?
Q19
What is meant by container ship?
Q20
To what kind of elements does non-modifying sequence algorithm can be applied?
Q21
From where does the template class derived?
Q22
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--
Q23
Which access specifier is used where one wants data members to be accessed by other classes but not from outside objects?
Q24
How one can restrict a function to throw particular exceptions only?
Q25
Which classes can have vtable?