Which code line inserted instead of the comment below will cause the program to produce the expected output?

What is the output of the program?
#include
#include
using namespace std;
int main()
{
string s1[]= {"H" , "t" };
string s;
for (int i=0; i<2; i++) {
s = s1[i];
if (i==0)
s.insert(1,"ow");
else
s.push_back('o');
cout << s;
}
return( 0 );
}
A. It prints: HotoWhat happens when you attempt to compile and run the following code?
#include
using namespace std;
int main() {
float i = 1.0 / 2 * 2 / 1 * 2 / 4 * 4 / 2;
cout << i;
return 0;
}
A. It prints: 0What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A {
public :
void print() {
cout << "A ";
}
};
class B {
public :
void print() {
cout << "B ";
}
};
int main() {
B sc[2];
B *bc = (B*)sc;
for (int i=0; i<2;i++)
(bc++)->print();
return 0;
}
A. It prints: A AWhich code, inserted at line 10, generates the output "Hello World"? #include
#include
using namespace std;
string fun(string, string);
int main()
{
string s="Hello";
string *ps;
ps = ands;
//insert code here
return 0;
}
string fun(string s1, string s2)
{
return s1+s2;
}
A. coutWhat happens when you attempt to compile and run the following code?
#include
using namespace std; int compare(int, int);
int main()
{
int x = compare(10, 20);
cout << x;
return 0;
}
int compare(int i, int j)
{
return i }
B. It prints: 2
C. It prints: 1
D. It prints: 10
Which of the following is a user defined data type?
1:
struct person
{
char name[20];
int age;
};
2:
int l=2;
3:
enum color {red,blue, green};
A. 1If there is one, point out an error in the program
#include
using namespace std;
int main()
{
int i=1;
for(;;)
{
cout<
if(i>5)
break;
}
return 0;
}
A. Error in "if" statementWhat happens when you attempt to compile and run the following code?
#include
using namespace std;
int main(){
int i, j;
for(i = 0, j = 1; j < 2, i < 4; i++, j++);
cout << i << " " << j;
return 0;
}
A. It prints: 4 5What happens when you attempt to compile and run the following code?
#include
using namespace std;
#define DEF_A 0
int main(int argc, char *argv[]) {
cout << DEF_A;
return 0;
}
A. It prints: 1Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only C++ Institute exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your CPA-21-02 exam preparations and C++ Institute certification application, do not hesitate to visit our Vcedump.com to find your solutions here.