Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- int chocolate_price,my_cash;
- scanf("%d %d" ,&chocolate_price,&my_cash);
- if(my_cash>=chocolate_price)
- {
- printf("you can buy %d\n",my_cash/chocolate_price);
- }
- else
- {
- int extra=chocolate_price-my_cash;
- printf("Sorry!You need more %d BDT",extra);
- }
- return 0;
- }
- input
- 100 40
- or
- 40 100
- Ans
- Sorry!You need more 60 BDT
- or
- you can buy 2
Add Comment
Please, Sign In to add comment