CodeSolved

A comprehensive source of programming questions and exercises

The age of the father and the son

Practice Easy 55/ Download 1863 Views

Write a program that receives the age of father and son from the input and prints them (subtraction) in the output

46 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
# Get user input for father's age and son's age
a = int(input("Enter the father's age: "))  # Corrected the typo in the prompt
b = int(input("Enter the son's age: "))     # Prompt for son's age
# Calculate the age difference
d = a - b
# Print the result
print("Here is your result: ", d)
Dani.nejad Download Python
X=int(input("father's age: "))
Y=int(input("boy's age: "))
print(X-Y)
Farbod.313 Download Python
dadage = int(input("a: "))
sonage = int(input("b: "))
print(dadage-sonage)
Akams Download Python
tool = int(input("tool"))
arz = int(input("arz"))
print(tool * arz)
User 1437 Download Python
fatherAge=int(input("please set father age: "))
sonAge=int(input("please set son age: "))
print("minus =",fatherAge-sonAge)
Saeeda33 Download Python
a =int(input("sen pedar:"))
b = int(input("sen pesar:"))
tafazol = (a - b)
print("tafazol,sen=" ,tafazol)
User 1191 Download Python
print("salam azizam")
print("tafazol sen pedar va farzand  bezan berim ")
p = input("sen baba  :   ")
f = input("sen farzand:   ")
p = int(p)
f = int(f)
print ( "ekhtelaf senton:   " , p-f)
User 3026 Download Python
<< Previous page 1 2 5 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close