Skip to main content
Search
Search This Blog
Livecodo
Pages
Home
Courses
Blog
About us
More…
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
April 10, 2024
Java Program to calculate discount of 10% for purchase above 5000
import java.util.*; public class shop { public static void main(String[] args) { Scanner n=null; int a,b,c; n=new Scanner(System.in); System.out.println("enter amount"); a=n.nextInt(); if(a>=5000) { b=(a*10)/100; c=a-b; System.out.println("congrajulation you got 10% discount. pay only "+c+""); c=n.nextInt(); b=n.nextInt(); } else { System.out.println("pay "+a+""); } } }
Popular Posts
March 26, 2024
Dynamic Memory allocation in C
May 18, 2024
Searching and sorting Algorithm in C