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;
}

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;
}

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;
}

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;
}