Can you please say if my code is right? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can you please say if my code is right?

You have a certain number of 100 rupee notes, 10 rupee notes and 1 rupee notes with you. There is an item you want to buy whose price is given to you. Write a program to find if the item is affordable, that is the price of the item is less than or equal to the current money you have. Input ----- Four non negative integers. The first input is an integer representing the number of 100 rupee notes. The second input is an integer representing the number of 10 rupee notes. The third input is an integer representing the number of 1 rupee notes. The fourth input is an integer representing the price of the item. Output ------ You have to output 1 if the item is affordable. You have to output 0 if the item is not affordable. https://code.sololearn.com/cuXi2x8zzdj0/?ref=app https://code.sololearn.com/cuXi2x8zzdj0/?ref=app

26th Jan 2023, 1:23 PM
Aishwarya Manoharan
Aishwarya Manoharan - avatar
1 Answer
0
You can test your code to see if it is right. If it is behaving the way that you intend, then you've got it!
26th Jan 2023, 1:50 PM
Justice
Justice - avatar