What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int i=5;
switch(i)
{
case 1:
cout<<"Hello";
break;
case 2:
cout<<"world";
break;
case 3:
break;
default:
cout<<"End";
}
return 0;
}
What will variable "y" be in class B?
class A {
int x;
protected:
int y;
public:
int age;
};
class B : public A {
string name;
public:
void Print() {
cout << name << age;
}
};
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int fun(int x) {
return 2*x;
}
int main(){
int i;
i = fun(1) || fun(2);
cout << i;
return 0;
}
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class complex{
double re;
double im;
public:
complex() : re(1),im(0.4) {}
bool operator==(complex &t);
};
bool complex::operator == (complex &t){
if((this?>re == t.re) && (this?>im == t.im))
return true;
else
return false;
}
int main(){
complex c1,c2;
if (c1==c2)
cout << "OK";
else {
cout << "ERROR";
}
}
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int i = 4;
while(i >= 0) {
cout<
i??;
}
return 0;
}
Shawna
9 days agoDonte
19 days agoMiss
24 days agoAretha
1 months agoRikki
2 months agoNickolas
2 months agoBobbye
2 months agoLeota
2 months agoDona
2 months agoStefania
3 months agoWalton
4 months agoGlory
4 months agoShawna
5 months agoTequila
5 months agoCordelia
5 months agoChuck
5 months agoBeckie
6 months ago