9.2k views
2 votes
Write a program that shows user input age and outputs "your age" followed by their age

User Luxdvie
by
4.6k points

2 Answers

4 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 Omegasbk
by
4.6k points
4 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 Young Emil
by
5.5k points