- 3
Confused
If iNT X =2 AND iNT Y= 4 INT RESTULT= X [ ] [ ]? #coNFUSED
15 Answers
+ 6
Please debug your post
Language?
Expected result
Actual result
If possible hack ur code into SL and post a link.
+ 4
Bruh... Just add the two variables together...
int result = x + y;
+ 3
Well, you can count me in on being confused too.
Can you elaborate on your question, or maybe show us the full code?
+ 3
Maybe you should read this lesson again.
You have to variables:
int x = 2;
int y = 4;
You want to store the sum in a third variable:
result = x + y;
You want to print the sum. Just print the value of result:
System.out.println(result);
+ 3
Mohammed Elbaba
Your right. To print the sum it would be enough to write System.out.println(x + y).
But such example codes helps you to learn what you can do. At the moment maybe you don't need a third variable but one day you will need it.
For example if you have to do more then to print it.
+ 2
Mohammed Elbaba and what does confuse you?
+ 2
Mohammed Elbaba
Can explain it? Don't you understand why it is stored in the third variable? Or don't you understand how it works?
0
it is java
0
int x= 2 int y= 4
int result=
system.out.printIn=
0
fill in the blank to complete the sum of the two variables
0
and what about the system print in
0
i know i already did it
0
the whole sum in the third variable thing
0
i donr understand why
- 1
so it would be
int x = 2 inty y = 4
int result= x+y
sustem,out,printin=?