C++ Quiz 1

Welcome to the C++ Quiz 1.
No time limit for this quiz. Read the questions carefully and choose the correct options.

Name
1. C++ is an alias of C#
2. What data type is used to create a variable that should store text?
3. How do you create a variable with the floating number 2.8?
4. The value of a string variable can be surrounded by single quotes.
5. Which statement is used to stop a loop?
6. Choose the correct output
#include <iostream>

using namespace std;

int main()
{

int m=11;
m += 1.1;
cout<<m;

return 0;
}
7. Find the correct output below C++ Code
#include <iostream>

using namespace std;

void a(int s);

int main()
{

int s=48;
a(s);
cout<<s;

return 0;
}

void a(int s)
{
s = s+10;
}
8. Choose the correct output
#include "iostream"
#include "cstring"
using namespace std;

int main()
{
char a[] = "Com\0puter";
cout<<strlen(a);

return 0;
}
9. Guess the output of code below
#include "iostream"
using namespace std;

int main()
{
int m=1;

if(m == 2);
cout<<"Hii";

cout<<" Hello";
return 0;
}
10. Objects created using new operator are stored in __ memory.

Admin

Back to top