Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Alice buys a toy with a selling price of 100 rupees. There is a discount of x percent on the toy. Find the amount Alice needs to pay for it.
For each test case, output on a new line the price that Alice needs to pay.
Input: 4
5
9
11
21
Output: 95
91
89
79
Test case 1: The discount is 5 percent, i.e. 5 rupees. So, Alice will have to pay 100−5=95 rupees.
for _ in range(int(input())):
a=int(input())
print(100-a)
#include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
if(t>=1&&t<=100)
{
while(t--)
{
int x;
cin>>x;
cout<<(100-(100*0.01*x))<<endl;
}
}
return 0;
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner (System.in);
int t=sc.nextInt() ;
while(t-->0){
int n=sc.nextInt() ;
System.out.println(100-n);
}
}
}
In our experience, we suggest you solve this Discount CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Discount CodeChef Solution
I hope this Discount CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>