What happens when you attempt to compile and run the following code?
What happens when you attempt to compile and run the following code? #include <iostream> #include <string> using namespace std; class A { public: A() { cout << "A no parameters";} A(string s) { cout << "A string parameter";} A(A &a) { cout << "A object A parameter";} }; class B:...
Which of the structures is incorrect?
Which of the structures is incorrect? 1: struct s1{ int x; long int li; }; 2: struct s2{ float f; struct s2 *s; }; 3: struct s3{ float f; struct s3 s; };A . 1B . 2C . 3D . 2, 3View AnswerAnswer: C
p?>age = p?
What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; void set(struct person*); struct person { int age; }; int main() { struct person e = {18}; set(&e); cout<< e.age; return 0; } void set(struct person *p) { p?>age = p?>age + 1;...
What happens when you attempt to compile and run the following code?
What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; int main() { int x=2, *y, z=3; y = &z; cout<<x**y*x***y; return 0; }A . It prints: 36B . It prints: 14C . It prints: 16D . Compilation errorView AnswerAnswer: D
What happens when you attempt to compile and run the following code?
What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; int main() { int *t; t = new int[2]; for (int i=0; i<2; i++) { t[i]=0; } cout << t[1]; }A . It prints: 0B . It prints: 1C . It prints: 2D...
What happens when you attempt to compile and run the following code?
What happens when you attempt to compile and run the following code? #include <iostream> #include <string> using namespace std; class A { public: A() { cout << "A no parameters";} A(string s) { cout << "A string parameter";} A(A &a) { cout << "A object A parameter";} }; class B:...
Which of the following can be checked in a switch? Case statement?
Which of the following can be checked in a switch? Case statement?A . charB . intC . enumD . doubleView AnswerAnswer: A, B, C
Which of the following is a logical operator?
Which of the following is a logical operator?A . &B . &&C . ||D . !View AnswerAnswer: B, C, D
What happens when you attempt to compile and run the following code?
What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; int fun(int x) { return 2*x; } int main(){ int i; i = fun(1) & fun(0); cout << i; return 0; }A . It prints: 0B . It prints: 1C . It prints:...
Which of the following statements are correct about an array?
Which of the following statements are correct about an array? int tab[10];A . The array can store 10 elements.B . The expression tab[1] designates the very first element in the array.C . The expression tab[9] designates the last element in the array.D . It is necessary to initialize the array...