What happens when you attempt to compile and run the following code? #include <iostream>using namespace std;struct { int x; char c; union {float f; int i;};} s;int main (int argc, const char * argv[]){s.x=10;s.i=0;cout << s.i << " " << s.x;}
What happens when you attempt to compile and run the following code? #include <iostream>#include <string>using namespace std; struct Person {string name; int age;};class First{Person *person;public:First() {person = new Person; person?>name = "John"; person?>age = 30;}void Print(){cout<<person?>name << " "<< person?>age;}};int main(){First t; t.Print();}
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;}
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;}
What is the output of the program given below? #include <iostream>using namespace std;int main (int argc, const char * argv[]){float f=?10.501; cout<<(int)f;}