ExamVeda
Login
Home
1
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;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
2
Pick out the in correct type of function in header file.
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
3
What will act as a intermediate between i/o operations and physical file?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
4
What will happen when an exception is not processed?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
5
Which operator is used to insert the data into file?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
6
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;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
7
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;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
8
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;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board