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; void fun(int*); int main() { int i=2; fun(&i); cout<<i; return 0; } void fun(int *i) { *i = *i**i; }A . It prints: 1 B.It prints: 4 C.It prints: 10 D.It prints: 0View...
Which code, inserted at line 14, generates the output "3.14 10"?
Which code, inserted at line 14, generates the output "3.14 10"? #include <iostream> using namespace std; namespace myNamespace1 { int x = 5; int y = 10; } namespace myNamespace2 { float x = 3.14; float y = 1.5; } int main () { //insert code here cout << x...
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 . 1 B.2 C.3 D.2, 3View AnswerAnswer: 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> #include <cstdarg> using namespace std; int mult(int f, int s, int t); int main() { cout << mult(1,2,3); return 0; } int mult(int f, int s, int t) { int mult_res; mult_res = f*s*t; return mult_res;...
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 argc, const char * argv[]) { int a = 30, b = 1, c = 5, i=10; i = b < a < c; cout << i; return 0; }A...
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; void fun(char*); int main() { char t[4]={'0', '1', '2', '3'}; fun(&t[2]); return 0; } void fun(char *a) { cout << *a; }A . It prints: 2 B.It prints: 21 C.It prints: 00 D.It...
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...
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 *i; i = new int; *i = 1.0 / 2 * 2 / 1 * 2 / 4 * 4; cout << *i; return 0; }A . It prints: 0...
obj?
What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class A { public: void Print(){ cout<<"A";} }; class B:public A { public: void Print(){ cout<< "B";} }; int main() { A *obj; A ob1; obj = &ob1; obj?>Print(); B ob2; obj =...