Welcome to pickSourcecode.com Login | Register    
pickZy.com
 Home  | search  | games  | General  | C  | C++  | Java  | Php  | Networking  | Visual Basic  | VC++  | Win32  | MFC  | JavaScript  | Jobs  | JavaScript  | Post jobs
Program to convert given no. of days into months and days. in java       Share
2008-11-18 |  jayaprakashmanoharan  | Viewed: 767  |    0

Program to convert given no. of days into months and days. in java


/* Write a program to convert given no. of days into months and days.

  (Assume that each month is of 30 days)

  Example :

           Input - 69

           Output - 69 days = 2 Month and 9 days */

class DayMonthDemo{

      public static void main(String args[]){

      int num = Integer.parseInt(args[0]);

      int days = num%30;

      int month = num/30;

      System.out.println(num+" days = "+month+" Month and "+days+" days");

   }

}


Comments:





Submit comment's

Type:

User Comment's:

Submitted By:
Prof: lecturer
Tech: C ,Java
Send Mail: prakash_zones



Related topics
java - Basic program in java
java - comparison operators
java - The switch Statement
java - The switch Statement - 2
java - The break Statement
java - Continue statement
Java - Display Current date and Time
Simple Text Editor in Java
Fun : "Flames"
FUNCTIONS WITH DEFAULT ARGUMENTS
How to Upload a File and How to Store it using socket?
Sounds Handling using Java applets
Display AWT objects
Multiplication table in Java
Find Maximum of 2 nos. in java

Related References
java - the equality and relational operators
java - bitwise and bit shift operators
java - the while and do-while statements
java - the if-then and if-then-else statements
java - the switch statement
java - the for statement
java - the break statement
java interview questions
jdbc interview questions
objective type questions in java
what are packages?
simple data types in java
html buttons
interview questions in java packages and interfaces
interface in java

Web site contents Copyright 2007, All rights reserved.
Help | Terms and Conditions | Privacy Policy | About Us