Question 1 of 11
Hints left: 3
Q1
What is the difference between get() and at()?
Q2
Pick out the in correct type of function in header file.
Q3
What will be the output of the following C++ code? #include <iostream> #include <algorithm> #include <vector> using namespace std; int main () { int myints[] = {10, 20, 30, 30, 20, 10, 10, 20}; int mycount = count (myints, myints + 8, 10); cout << mycount; vector<int> myvector (myints, myints + 8); mycount = count (myvector.begin(), myvector.end(), 20); cout << mycount; return 0; }
Q4
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 <int>a1; A <char>a2; A <float>a3; return 0; }
Q5
How the different permutations are ordered in c++?
Q6
What will happen when an exception is not processed?
Q7
What will be the output of the following C++ code in text file? #include <stdio.h> int main () { FILE * p; char buffer[] = { 'x' , 'y' , 'z' }; p = fopen ( "myfile.txt" , "wb" ); fwrite (buffer , 1 , sizeof(buffer) , p ); fclose (p); return 0; }
Q8
What will act as a intermediate between i/o operations and physical file?
Q9
What is the use of accumulate function in a numeric library?
Q10
Which operator is used to insert the data into file?
Q11
What will be the output of the following C++ code by manipulating the text file? #include <stdio.h> int main () { if (remove( "myfile.txt" ) != 0 ) perror( "Error" ); else puts( "Success" ); return 0; }