What 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;
}
What is the output of the program if character 4 is supplied as input?
#include 
using namespace std;
int main () {
int c;
cin >> c;
try
{
switch (c)
{
case 1:
throw 20;
case 2:
throw 5.2f;
case 3:
throw 'a';
default:
cout<<"No exception";
}
}
catch (int e)
{ cout << "int exception. Exception Nr. " << e; }
catch (float e)
{ cout << "float exception. Exception Nr. " << e; }
catch (...)
{ cout << "An exception occurred."; }
return 0;
}
What will happen when you attempt to compile and run the following code?
#include 
using namespace std;
int main()
{
const char *s;
char str[] = "Hello ";
s = str;
while(*s) {
cout << *++s;
*s++;
}
return 0;
}
What happens when you attempt to compile and run the following code?
#include 
#include 
using namespace std;
class myClass : public exception
{
virtual const char* what() const throw()
{
return "My exception.";
}
} obj;
int main () {
try
{
throw obj;
}
catch (exception& e)
{
cout << e.what() << endl;
}
return 0;
}
What happens when you attempt to compile and run the following code?
#include 
using namespace std;
int main (int argc, const char * argv[])
{
int a = 30, b = 1, c = 5, i=10;
i = b < a < c;
cout << i;
return 0;
}
What is the output of the program if characters 't', 'e', 's' and 't' enter are supplied as input?
#include 
#include 
using namespace std;
int main()
{
string s;
getline( cin, s );
cout << s << " " << s.length();
return( 0 );
}
What happens when you attempt to compile and run the following code?
#include 
using namespace std;
int x=5;
static int y;
int i=0;
void static myFunction()
{
y=x++ + ++i;
}
int main (int argc, const char * argv[])
{
x++;
myFunction();
cout< }
Point out an error in the program.
#include 
using namespace std;
int main()
{
const int x=1;
int const *y=&x;
cout<<*y;
return 0;
}
What happens when you attempt to compile and run the following code?
#include 
using namespace std;
int x=5;
static int y=0;
void myFunction(int a)
{
y=++a;
}
int main (int argc, const char * argv[])
{
int i=0;
myFunction(i);
cout< }
Which of the following is a logical operator?
 
				