Which of the following is the scope resolution operator?
What will be the output of the following C++ code?
Which function can retrieve the absolute integer value?
To which of these data types can enumerators be assigned?
Which type of C++ cast can be used only with pointers and references to objects?
Output justification such as decimal point, numerical sign, trailing zeros or octal are specified by the _______ field.
Pointers can be used to dynamically allocate storage from the _____ at _____.
What is the output of the following code?
int swap(int *num1, int *num2)
{
*num1=*num1+*num2;
*num2=*num1-*num2;
*num1=*num1-*num2;
}
int main()
{
int f_num=10,s_num=20;
swap(&f_num, &s_num);
printf("%d%d",f_num,s_num);
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
// declaring Boolean
// variable with true value
bool a = true;
for (a = 1; a <= 5; a++)
cout << a;
return 0;
}
#include <iostream>
using namespace std;
class Rectangle {
int width, height;
public:
void set_values (int,int);
int area() {return width*height;}
};
void Rectangle::set_values (int x, int y) {
width = x;
height = y;
}
int main () {
Rectangle rect;
rect.set_values (3,4);
cout << rect.area();
return 0;
}