What happens when you attempt to compile and run the following code?
#include
using namespace std;
void fun(int*);
int main()
{
int i=2;
fun(&i);
cout<
return 0;
}
void fun(int *i)
{
*i = *i**i;
}
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A {
public:
int x;
A() { x=0;}
};
class B : protected A {
public:
int y;
using A::x;
B(int y) {this?>y = y;}
void Print() { cout << x << y; }
};
int main () {
B b(5);
b.Print();
return 0;
}
Which code, inserted at line 10, generates the output "2?1"?
#include
#include
using namespace std;
class A {
protected:
int y;
public:
int z;
};
//insert code here
public:
void set() {
y = 2;
z = 3;
}
void Print() { cout << y << z; }
};
int main () {
B b;
b.set();
b.z = ?1;
b.Print();
return 0;
}
What is the output of the program?
#include
#include
using namespace std;
int main () {
string s1 = "Hello", s2 = "World";
s2 = s1 + s2;
cout << s2;
return 0;
}
What is the output of the program if character 4 is supplied as input?
#include
using namespace std;
int main () {
int c;
cin >> c;
try
{
switch (c)
{
case 1:
throw 20;
case 2:
throw 5.2f;
case 3:
throw 'a';
default:
cout<<"No exception";
}
}
catch (int e)
{ cout << "int exception. Exception Nr. " << e; }
catch (float e)
{ cout << "float exception. Exception Nr. " << e; }
catch (...)
{ cout << "An exception occurred."; }
return 0;
}
Nancy Baker
13 days agoMark King
29 days agoMichael Bell
1 month agoSarah Hernandez
2 months agoBrenda Martin
3 months agoMark Moore
3 months agoLisa Bailey
4 months agoCynthia Bailey
4 months agoJohn Moore
4 months agoJohn White
4 months agoSandra Ramirez
4 months agoDennis Wilson
4 months agoMelissa Flores
4 months agoGeorge Moore
4 months agoPaz
5 months agoGussie
5 months agoColette
6 months agoYolande
6 months agoDaniel
6 months agoDominga
6 months agoKarina
7 months agoLuisa
7 months agoQueenie
7 months agoPaul
7 months agoEliz
8 months agoRoyal
8 months agoShawnda
8 months agoTonja
8 months agoLucy
9 months agoMaybelle
9 months agoIsadora
9 months agoPrincess
10 months agoWeldon
10 months agoPaola
10 months agoBok
10 months agoBecky
11 months agoStephania
11 months agoCatarina
11 months agoHaley
11 months agoDell
12 months agoWhitley
1 year agoStephaine
1 year agoLazaro
1 year agoCeola
1 year agoAlecia
1 year agoThomasena
1 year agoHannah
2 years agoRonny
2 years agoEttie
2 years agoBrittni
2 years agoTijuana
2 years agoStephania
2 years agoIlene
2 years agoNoel
2 years agoShawna
2 years agoDonte
2 years agoMiss
2 years agoAretha
2 years agoRikki
2 years agoNickolas
2 years agoBobbye
2 years agoLeota
2 years agoDona
2 years agoStefania
2 years agoWalton
2 years agoGlory
2 years agoShawna
2 years agoTequila
2 years agoCordelia
2 years agoChuck
2 years agoBeckie
2 years ago