281,815 views
19 votes
19 votes
Write a program that shows user input age and outputs "your age" followed by their age

User Borba
by
2.7k points

2 Answers

15 votes
15 votes

Answer: if it is in JS then its

var age = 17 ;

(or what ever your age is)

console.log (age);

Explanation: var is short for variable and when you use it what ever you make the name you can use when ever in your code the console.log is to make the output the question is requesting

User Lim Socheat
by
3.1k points
13 votes
13 votes

C++:

#include <iostream>

int main() {

int f; std::cin>>f;

std::cout << "Your age is: " << f;

return 0;

}

Python:

f = input("Age: ")

print("Your age is: ",f)

User Carl Binalla
by
2.9k points