Which of the following is not a primitive data type in C++?
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Which of the following is a correct way to declare a variable in C++?
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
cout << x++ << endl;
cout << ++x << endl;
return 0;
}
Which of the following arithmetic operators is used for exponentiation in C++?
Which of the following is a valid way to declare a constant variable in C++?
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << x / y << endl;
cout << x % y << endl;
return 0;
}
Which of the following is the correct syntax for a single-line comment in C++?
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x + y = " << x + y << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x - y = " << x - y << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x * y = " << x * y << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x / y = " << x / y << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x % y = " << x % y << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x += y; x = " << (x += y) << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x -= y; x = " << (x -= y) << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x *= y; x = " << (x *= y) << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x /= y; x = " << (x /= y) << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << "x %= y; x = " << (x %= y) << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int z = 4;
int result = x + y * z;
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int z = 4;
int result = (x + y) * z;
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = ++x * y--;
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = (x++) * (++y);
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = (x++) + (y--);
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = x++ + ++y;
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = x-- * ++y;
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = --x + y++;
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = ++x + y++;
cout << "Result: " << result << endl;
return 0;
}
What is the output of the following code snippet?
#include <iostream>
using namespace std;
int main() {
int x = 2;
int y = 3;
int result = x++ * --y;
cout << "Result: " << result << endl;
return 0;
}
70 videos|45 docs|15 tests
|
70 videos|45 docs|15 tests
|