- 1

Can my code is correct?

import java.util.*; // Compiler version JDK 11.0.2 class Dcoder { public static void main(String args[]) { int age; System.out.println("enrer your age:"); Scanner obj=new Scanner(System.in); age=obj.nextInt(); if(age>18) { System.out.println("elageble for vote"); } else{ System.out.println("not for elageble for vote"); } } }

26th Jul 2022, 4:58 AM
Sachin Patel
Sachin Patel - avatar
9 Answers
+ 1
Sachin Patel Is there any issue?
3rd Aug 2022, 8:57 AM
A͢J
A͢J - avatar
+ 2
Solve ho gya sir rawinput
3rd Aug 2022, 9:01 AM
Sachin Patel
Sachin Patel - avatar
+ 1
A͢J #python 2.7.15 letter='''Dear <|name|>,\n your are salected,Date <|date|>''' name=input("enter yor name") date=input("enter dalte") letter=letter.replace("<|name|>",name) letter=letter.replace("<|date|>",date) print(letter)
3rd Aug 2022, 8:34 AM
Sachin Patel
Sachin Patel - avatar
+ 1
Jayakrishna🇮🇳 #python 2.7.15 letter='''Dear <|name|>,\n your are salected,Date <|date|>''' name=input("enter yor name") date=input("enter dalte") letter=letter.replace("<|name|>",name) letter=letter.replace("<|date|>",date) print(letter)
3rd Aug 2022, 8:34 AM
Sachin Patel
Sachin Patel - avatar
+ 1
A͢J no sir i funded error, raw_input। Thank you
3rd Aug 2022, 8:59 AM
Sachin Patel
Sachin Patel - avatar
+ 1
Sachin Patel Kuch issue hai code me ya bas aise hi share kiya hai?
3rd Aug 2022, 8:59 AM
A͢J
A͢J - avatar
0
bhu study point1625 What is your question?
26th Jul 2022, 5:16 AM
A͢J
A͢J - avatar
0
bhu study point1625 You missed to import Scanner class
26th Jul 2022, 5:28 AM
A͢J
A͢J - avatar
0
You can check it in java playground here.. Is there any difficulty facing?
26th Jul 2022, 9:00 AM
Jayakrishna 🇮🇳