0
The question is given in description
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
11 odpowiedzi
0
#include <stdio.h>
int main(){
int hundred , ten , one , price;
scanf("%d %d %d %d" , &hundred , &ten , &one , &price);
if(hundred <0 || ten<0 || one<0 || price<0){
printf("%d" ,0);
return 0;
}
if(price < (hundred*100 + ten*10 + one)){
printf("%d" , 1) ;
}
else{
printf("%d" , 0);
}
return 0;
}
0
🍆🍆🖕🏿🖕🏿🖕🏿🖕🏿😂🤮🤮🥰🥰
0
#include<stdio.h>
int main()
{
int Hundred;
int Ten;
int One;
int Price;
scanf("%d %d %d %d",&Hundred,&Ten,&One,&Price);
if(Hundred<0 || Ten<0 || One<0 || Price<0)
{
printf("%d",0);
return 0;
}
if(Price<(Hundred*100+Ten*10+One))
{
printf("The item is affordable %d",1);
}
else
{
printf("The item is non affordable %d",0);
}
return 0;
}
0
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.
nput
-----
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.
0
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.
0
#include <stdio.h>
int main(){
int hundred , ten , one , price;
scanf("%d %d %d %d" , &hundred , &ten , &one , &price);
if(hundred <0 || ten<0 || one<0 || price<0){
printf("%d" ,0);
return 0;
}
if(price < (hundred*100 + ten*10 + one)){
printf("%d" , 1) ;
}
else{
printf("%d" , 0);
}
return 0;
}
0
#include <stdio.h>
int main(){
int hundred , ten , one , price;
scanf("%d %d %d %d" , &hundred , &ten , &one , &price);
if(hundred <0 || ten<0 || one<0 || price<0){
printf("%d" ,0);
return 0;
}
if(price < (hundred*100 + ten*10 + one)){
printf("%d" , 1) ;
}
else{
printf("%d" , 0);
}
return 0;
}
0
its not executed
0
#include<stdio.h>
int main()
{
int h, t, o, tot;
scanf("%d", &h);
scanf("%d", &t);
scanf("%d", &o);
scanf("%d", &pr);
int total = (100*h )+ (10*t) + o;
if(total == pr)
{
printf("1");
}
else
{
printf("0");
}
}