In 3126, everyone knows about System.out.println() and uses it often. It's not just CodeGym students that begin to learn programming with this command. Even children do. Let's write a program that displays my friend's true birth year. He was born 8 years ago.
My young friend
- 2
Locked
Comments (85)
- Popular
- New
- Old
You must be signed in to leave a comment
zam
23 May, 03:16
public class Solution {
public static void main(String[] args) {
int year = 3126;
int ago = 8;
System.out.println(year - ago);
}
}
+2
Abrar Mirje
5 May, 05:54
int currentDays = 3126;
int age = currentDays - 8;
System.out.println(age);
0
PRIYANKA DEWARE
13 April, 17:03
int a = 3126;
int b = a - 8 ;
System.out.println("my friends birth year.");
System.out.println(b);
0
Khent E. Palermo
19 March, 14:28
nice one guys for the tip
0
Nomophobic Girl
11 March, 16:12
And the answer is...
System.out.print("my friends birth year");
System.out.println(3118);
0
hidden #11284516
13 February, 11:17
int year=3126;
int age=8;
System.out.println(year-age);
0
kaeln023
4 January, 13:28
System.out.println(3126-8);
0
A learner
4 April, 10:13
I dont know why but this is correct on the other hand they say that outputbin text and display my friend's birthday year
0
hidden #11220344
18 December 2022, 00:25
How come it doesn't work even after looking at the hint?
+1
hidden #11220344
18 December 2022, 00:11
Where it says the program should output text, does it mean string?
0
A learner
4 April, 10:15
Yeah but it is wrong the outpit is only in int
0
Emma Afonso
6 December 2022, 23:56
got it 2 try
0