What is the output of the below given code?
int y = 9;
y += y+3;
printf("%d",y);
+ = → is an assignment operator
y+ = y+3
y = y + (y + 3)
y = 9 + (9 + 3)
y = 21
Note:
Assignment operator associativity is right to left
What is the output of the below given code?
int y = 9;
y += y+3;
printf("%d",y);
+ = → is an assignment operator
y+ = y+3
y = y + (y + 3)
y = 9 + (9 + 3)
y = 21
Note:
Assignment operator associativity is right to left
No discussions yet. Be the first to start!
You must be logged in to participate in the discussion.
login Login to DiscussSelect the correct option that will fill in the blank and complete the series.
VIRT, UHQT, TGPT, SFOT, _______
The pattern here is as follows:
Hence, RENT is the correct answer.
The following question consists of a related pair of words, followed by four pairs of words. Choose the pair that best represents a similar relationship to the one expressed in the original pair of words.
COBBLER : SHOESGiven : Cobbler : Shoes – Cobbler mends our shoes.
Electrician : Screw – Screw is a tool used by electricians.
Carpenter : Jig – Jig is a tool used by carpenters.
Mechanic : Car – Mechanic mends our cars.
Manager : Office – Manager is a superior person who handles the administrative work of an office.
Hence, Mechanic : Car holds the similar relationship.Select the option in which the given word pair has the same relation between the given word pair in the question.
Pen : Writing
In this question we shows that Pen is used for Writing.
Similarly, Spoon is used for Eating.
But Gun comes under Weapon, Teacher teach in School and Eraser and Pencil is different things.
Option 1, 3 and 4 is not correct.
Hence, "Spoon : Eating" is the correct answer.
The following question consists of a related pair of words followed by four pairs of words. Choose the pair that best represents a similar relationship to the one expressed in the original pair of words.
Country : President :: State : ?President is the head of the Union Executive of a country.
Similarly,
Governor is the head of State Executive.|
Word |
S |
T |
E |
A |
D |
Y |
|
Code |
5 |
8 |
2 |
@ |
# |
$ |
|
Word |
E |
N |
T |
R |
Y |
|
Code |
2 |
& |
8 |
4 |
$ |
Thus, ‘SEDATE’ can be coded as:
|
Word |
S |
E |
D |
A |
T |
E |
|
Code |
5 |
2 |
# |
@ |
8 |
2 |
Hence, the code for SEDATE is 52#@82.