Proxy > Gmail Facebook Yahoo!

25. Write a program to read the price of an item in decimal form (like 75.95) and print the output in paise (7595 paise)




import java.util.*;
public class ConvertInPaise {
 
 
  public static void main(String[] args)
  {
    Scanner scan=new Scanner(System.in);
    System.out.print("Enter Price in Rupees(p):");
    double p=scan.nextDouble();
    int paise=(int) p*100;
    System.out.println("Price in paise ="+paise);
  }
 
}


Responses

0 Respones to "25. Write a program to read the price of an item in decimal form (like 75.95) and print the output in paise (7595 paise)"


Send mail to your Friends.  

Expert Feed

 
Return to top of page Copyright © 2011 | My Code Logic Designed by Suneel Kumar