Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
iam writing java code of if else statement for condition that if age above 18 print "adult" else print "not adult" in visual studio code but in terminal it is not giving output as "adult" or "not adult" to the input value of age variable , how to fix it

What I have tried:

i have tried asking it to many other coders but none has answered it
Posted
Updated 18-Mar-23 6:49am
Comments
0x01AA 18-Mar-23 12:23pm    
Share your code if you expect help. Use 'Improve question' to add your relevant code snippets.

1 solution

Java
if (age > 18)
{
    System.out.println("adult")
}
else
{
    System.out.println("not adult")
}
 
Share this answer
 
v4
Comments
0x01AA 18-Mar-23 13:26pm    
v4 :-)
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900