Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
struct sec {
4.
int a;
5.
char b;
6.
};
7.
int main()
8.
{
9.
struct sec s ={25,50};
10.
struct sec *ps =(struct sec *)&s;
11.
cout a b;
12.
return 0;
13.
}
Options:
A .  252
B .  253
C .  254
D .  262
Answer: Option A

In this program, We are dividing the values of a and b, printing it.
Output:
$ g++ stu5.cpp
$ a.out
252



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers