What will be the output of the program?
#include <iostream>
#include <string>
using namespace std;
int fun(int);
int main()
{
float k=3;
k = fun(k);
cout<<k;
return 0;
}
int fun(int i)
{
i++;
return i;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
int i = 4;
while(i >= 0) {
cout<<i;
i??;
}
return 0;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main()
{
int i = 5;
cout<<"Hello World" << ++i;
return 0;
}
What happens when you attempt to compile and run the following code?
#include <iostream>
#include <string>
using namespace std;
class A {
public:
int age;
A () { age=5; };
};
class B : private A {
string name;
public:
B () { name="Bob"; };
void Print() {
cout << name << age;
}
};
int main () {
B b,*ob;
ob = &b;
ob?>age = 10;
ob?>Print();
return 0;
}
What happens when you attempt to compile and run the following code?
What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int main() {
int i, j;
for(i = 0; i < 2; i++) {
for(j = i; j < i + 1; j++)
if(j == i)
continue;
else
break;
}
cout << j;
return 0;
}
How many copies of the value member are stored in memory during program execution?
Which code line inserted instead of the comment below will cause the program to produce the expected output?
What happens when you attempt to compile and run the following code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1[]= {"H" , "t" };
string s;
for (int i=0; i<2; i++) {
s = s1[i];
s.insert(1,"o");
cout << s;
}
return( 0 );
}
What is the output of the program?
#include <iostream>
#include <string>
using namespace std;
int main()
{
char str[] = "Hello\0\World\0";
cout << str;
return 0;
}
PDF + Testing Engine
|
---|
$57.75 |
Testing Engine
|
---|
$43.75 |
PDF (Q&A)
|
---|
$36.75 |
C++ Institute Free Exams |
---|
![]() |