write a program to calculate electricity bill in c #shorts

preview_player
Показать описание
Hey coder, This is Shivam is here, and in this video, I share the information about the C language, I mean, how to write a program to calculate electricity bills in the C language.
I hope you enjoyed this program.
#shorts #pwos #shivam
Рекомендации по теме
Комментарии
Автор

Python can do this much better
print(f"Electricity bill: {(add := 0 if (units := int(input('Enter number of units you used: '))) < 50 else 130 if units <= 100 else 292.5 if units <= 200 else 818.5) + (((units - (0 if units <= 50 else 50 if units <= 100 else 100 if units <= 200 else 200))) * (2.6 if units < 50 else 3.25 if units <= 100 else 5.26 if units <= 200 else 7.75)) + (25 if add == 0 else 35 if add == 130 else 45 if add == 292.5 else 55)}")
Short code

tathyagarg
Автор

Nice I understood some parts of this program. 😁

roycephantom
Автор

Which software are you using for compilation of all programs in pc

anithakumarim
Автор

Video ma kuch nazar hi nahi aa raha hai

Lnctiann
Автор

Python can do this much better
print(f"Electricity bill: {(add := 0 if (units := int(input('Enter number of units you used: '))) < 50 else 130 if units <= 100 else 292.5 if units <= 200 else 818.5) + (((units - (0 if units <= 50 else 50 if units <= 100 else 100 if units <= 200 else 200))) * (2.6 if units < 50 else 3.25 if units <= 100 else 5.26 if units <= 200 else 7.75)) + (25 if add == 0 else 35 if add == 130 else 45 if add == 292.5 else 55)}")
Short code

tathyagarg