What will be the output of the following C++ code?
What symbol is used to create multiple inheritance in programming?
What is the index number of the last element of an array with 9 elements?
main( )
{
int i=1;
switch( i)
{
case 1: goto label;
lable: case 2: printf(“hi”);
break;
}
Printf(“hello”);
}
The array is as follows: 1,2,3,6,8,10. At what time the element 6 is found? (By using linear search(recursive) algorithm)
Is the following statement True or False?
If the expression e evaluates to the null pointer, then it is guaranteed that e+0 evaluates to the null pointer, too.
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str("Steve jobs");
cout << str.capacity() << "\n";
return 0;
}
What will be the output of the following C++ code?
#include<iostream>
using namespace std;
int main()
{
double a = 21.09399;
float b = 10.20;
int c, d;
c = (int)a;
d = (int)b;
cout << c << ' ' << d;
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
for (int i = 1; i <= 5; i++)
v.push_back(i);
int *pos = v.data();
cout << *(pos + 3);
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
#include <iterator>
#include <list>
using namespace std;
int main() {
list<int> mylist;
for (int i = 0; i < 10; i++) {
mylist.push_back(i * 10);
}
list<int>::iterator it = mylist.begin();
advance(it, 5);
cout << *it << endl;
return 0;
}