It's currently 3126. My friend was born 8 years ago.
Write a program that displays my friend's birth year.
My young friend
- 1
Locked
Comments (15)
- Popular
- New
- Old
You must be signed in to leave a comment
Hasan Özyer
9 May, 09:06
public class Solution {
public static void main(String[] args) {
//write your code here
int currentYear = 3126;
int friendAge = 8;
int friendBirth = currentYear - friendAge;
System.out.println(friendBirth);
}
}
0
Anonymous #11327312
17 April, 23:59
int currnetYear = 3126;
int friendAge = 8;
int friendBirth = currnetYear - friendAge;
System.out.println("You friend was born in "+friendBirth);
+1
Anonymous #11329842
12 April, 22:06
int year = 3126;
int age = 8;
System.out.println(year-age);
0
Dx Upscale
3 April, 17:29
Why is it declining;
public static void main(String[] args) {
int a;
int a = 3126-8;
System.out.println("Your friend's birth year is: " "+ a";
}
}
0
Allan Gilbert
23 March, 14:38
System.out.println(3126 - 8);
0
Misho Misho
7 January, 08:19
System.out.println("3118");
0
Irvansyah Irvansyah
30 December 2022, 02:45
you must try to currency 3126 - 8, just it
0
Phu Tran
29 November 2022, 07:41
What's conditions ?
0
Michaela Hrbková
9 August 2022, 11:59
why are there no int?
+3
Anonymous #11069021
26 August 2022, 05:23
Same question 🤔
0
Anonymous #11274451
22 March, 19:08
I'm just starting but i think because System.out.println("3118") actually displays 3118
I think ito use int, it'd have to be as a variable.
0
Anonymous #11038721
16 July 2022, 21:11
Hi
0