Give the output of the following :
int m=6, n=9;
System.out.println(“M+N=”+m+n);
Answers
Answered by
5
Question:-
➡Give the output of the following code.
Solution:-
Given code,
int m=6, n=9;
System.out.println(“M+N=”+m+n);
Here, m=6 and n=9
In the print statement, m+n will given output as 69 because m and n are not added, they will be considered as strings.
So,
required output:-
M+N=69
For verification, check out the attachment.
Attachments:
Similar questions
English,
2 months ago
World Languages,
2 months ago
Math,
5 months ago
India Languages,
10 months ago
India Languages,
10 months ago