What happens when you attempt to compile and run the following code?
#include
using namespace std;
void fun(int*);
int main()
{
int *x;
int i=2;
x=&i;
fun(x);
cout<
return 0;
}
void fun(int *i)
{
*i = *i * *i;
}
What happens when you attempt to compile and run the following code?
What is the output of the program if characters 'h', 'e', 'l', 'l' , 'o' and enter are supplied as input?
#include
#include
using namespace std;
void f();
int main()
{
f();
return 0;
}
void f()
{
char c;
c = cin.get();
cout << c;
if(c != '\n')
f();
}
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
void fun(int i);
int main()
{
int i=0;
i++;
for (i=0; i<=5; i++)
{
fun(i);
}
return 0;
}
void fun(int i)
{
if (i==3)
return;
cout << i;
}
What happens when you attempt to compile and run the following code?
What will be the output of the program?
#include
using namespace std;
int main()
{
const int y = 5;
const x = ?10;
cout< return 0; }
Which code lines inserted independently instead of the comment will make the following program work correctly? (Choose three.)
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A {
public:
void Print(){ cout<<"A";}
};
class C:public A {
public:
virtual void Print()=0;
};
int main()
{
C obj3;
obj3?>Print();
}
What happens when you attempt to compile and run the following code?
What will happen when you attempt to compile and run the following code?
#include
#include
using namespace std;
string fun(string, string);
int main()
{
string s="Hello";
cout << fun(s, " World");
return 0;
}
string fun(string s1, string s2)
{
return s1+s2;
}