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";
}
}
Stephania
7 days agoIlene
19 days agoNoel
23 days agoShawna
1 months agoDonte
2 months agoMiss
2 months agoAretha
2 months agoRikki
3 months agoNickolas
3 months agoBobbye
3 months agoLeota
3 months agoDona
3 months agoStefania
4 months agoWalton
5 months agoGlory
5 months agoShawna
6 months agoTequila
6 months agoCordelia
6 months agoChuck
6 months agoBeckie
7 months ago