What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int i = 0;
i++;
goto lab;
i++;
lab:
cout<
return 0;
}
A. It prints: 0
B. It prints: 34
C. It prints: 1
D. It prints: 3
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=andi;
fun(x);
cout<
return 0;
}
void fun(int *i)
{
*i = *i * *i;
}
A. It prints: 2
B. It prints: 4
C. It prints: 0
D. It prints: 1
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();
}
A. It prints: hello
B. It prints: olleh
C. It prints: h
D. It prints: o
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int x,y=10;
float f;
f = 5.90;
cout << f << ", ";
x=f;
cout << x <<", ";
f=y;
cout << f;
return 0;
}
A. It prints: 5, 5, 10.00
B. It prints: 5.9, 5, 10
C. It prints: 6, 5, 10
D. It prints: 6, 5, 10.00
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int f(int a, int b);
int main()
{
float b;
b = f(20,10);
cout << b;
return 0;
}
int f(int a, int b)
{
return a/b;
}
A. It prints: 2
B. It prints: 5
C. It prints: 10
D. It prints: 0
What happens when you attempt to compile and run the following code? #include
using namespace std;
int main(){
int i = 1;
if (i++==1) {
cout << i;
} else {
cout << i-1;
}
return 0;
}
A. It prints: 0
B. It prints: 1
C. It prints: -1
D. It prints: 2
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int mul (int a, int b=2)
{
int r;
r=a*b;
return (r);
}
int main ()
{
cout << mul(1) << mul(2,4);
return 0;
}
A. It prints: 2
B. It prints: 28
C. It prints: 8
D. It prints: 6
What will be the output of the program?
#include
using namespace std;
int main()
{
int i=0;
for(; i<=5; i++)
cout << i;
return 0;
}
A. 012345
B. 0123
C. 5
D. 6
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class complex{
double re;
double im;
public:
complex() : re(0),im(0) {}
complex(double x) { re=x,im=x;};
complex(double x,double y) { re=x,im=y;}
void print() { cout << re << " " << im;}
};
int main(){
complex c1;
c1.print();
return 0;
}
A. It prints: 1 0
B. It prints: 1 1
C. It prints: 0 0
D. Compilation error
How many times will "HELLO" be printed?
#include
using namespace std;
int main()
{
for(int i=?1; i<=10; i++)
{
if(i < 5)
continue;
else
break;
cout<<"HELLO";
}
return 0;
}
A. 1
B. 2
C. 0
D. 20
Nowadays, 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.