Q. WAP to compute the railway fare deepending on hte criteria as given below:

Age (in years)Distance (in Kms)Fare (in Rupees)
Below 10
Below 10Rs. 5
Between 10 and 50Rs. 20
Above 50Rs. 50
Between 10 and 60
Below 10Rs. 10
Between 10 and 50Rs. 40
Above 50Rs. 80
Above 60
Below 10Rs. 4
Between 10 and 50Rs. 15
Above 50Rs. 35
  • Enter your age: Below 10 Bet. 10 & 60 Above 60
  • Enter the distance to travel: Below 10 Bet. 10 & 50 Above 50
  • Enter the number of people:
  • Total Railway Fare: