+ 1

Write a program to input age of a person and print message 'eligible to vote' if age is more than 18 otherwise print message 'n'

9th Sep 2018, 11:36 AM
Ranik Sarkar
Ranik Sarkar - avatar
2 Réponses
+ 2
import java.util.Scanner; public class VoteEligible { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int Age = scan.nextInt(); if(Age>18) { System.out.println("eligible to vote"); } else { System.out.println("n"); } } }
9th Sep 2018, 12:11 PM
Rahul Roy
Rahul Roy - avatar
+ 1
age = input() if age > 18: print("eligible to vote") else: print("n")
9th Sep 2018, 2:05 PM
shadeyg56
shadeyg56 - avatar