- 3

Confused

If iNT X =2 AND iNT Y= 4 INT RESTULT= X [ ] [ ]? #coNFUSED

26th Jan 2020, 4:32 PM
Mohammed Elbaba
15 Respuestas
+ 6
Please debug your post Language? Expected result Actual result If possible hack ur code into SL and post a link.
26th Jan 2020, 4:37 PM
Oma Falk
Oma Falk - avatar
+ 4
Bruh... Just add the two variables together... int result = x + y;
26th Jan 2020, 4:42 PM
Hatsy Rei
Hatsy Rei - avatar
+ 3
Well, you can count me in on being confused too. Can you elaborate on your question, or maybe show us the full code?
26th Jan 2020, 4:37 PM
Hatsy Rei
Hatsy Rei - avatar
+ 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);
26th Jan 2020, 4:55 PM
Denise Roßberg
Denise Roßberg - avatar
+ 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.
26th Jan 2020, 5:08 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Mohammed Elbaba and what does confuse you?
26th Jan 2020, 4:57 PM
Denise Roßberg
Denise Roßberg - avatar
+ 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?
26th Jan 2020, 5:01 PM
Denise Roßberg
Denise Roßberg - avatar
0
it is java
26th Jan 2020, 4:38 PM
Mohammed Elbaba
0
int x= 2 int y= 4 int result= system.out.printIn=
26th Jan 2020, 4:40 PM
Mohammed Elbaba
0
fill in the blank to complete the sum of the two variables
26th Jan 2020, 4:40 PM
Mohammed Elbaba
0
and what about the system print in
26th Jan 2020, 4:45 PM
Mohammed Elbaba
0
i know i already did it
26th Jan 2020, 4:56 PM
Mohammed Elbaba
0
the whole sum in the third variable thing
26th Jan 2020, 4:58 PM
Mohammed Elbaba
0
i donr understand why
26th Jan 2020, 5:01 PM
Mohammed Elbaba
- 1
so it would be int x = 2 inty y = 4 int result= x+y sustem,out,printin=?
26th Jan 2020, 4:46 PM
Mohammed Elbaba