write aprogram that inputs an age and print age after 10years as shown below. for example: what is your age? 17.in ten years,your age will be 27 year old.
Answers
Answered by
2
Answer:-
//Java
//Assuming it is Java programming
import java.util.*;
class Age{
public static void main (String ar []){
Scanner sc=new Scanner (System.in);
System.out.print("What is your age? ");
int age=sc.nextInt();
System.out.println("In ten years, your age will be "+(age+10)+" years old");
}
}
#Python
age=(int)(input("What is your age? "))
print("In ten years, your age will be",age+10,"years old")
Qbasic
CLS
INPUT "WHAT IS YOUR AGE? ";AGE
PRINT "IN TEN YEARS, YOUR AGE WILL BE ";(AGE+10);" YEARS OLD"
END
Attachments:
Similar questions