Welcome to pickSourcecode.com Login | Register    
 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: 799  |    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");




Submit comment's


User Comment's:

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

Related topics
java - Basic program in java
java - comparison operators
Simple Text Editor in Java
How to Upload a File and How to Store it using socket?
Find Maximum of 2 nos. in java
Find Minimum of 2 nos. using conditional operator in java
A program that will read a float type value from the keyboard in Java
A program to generate 5 Random nos. between 1 to 100 in Java
Program to display a greet message according to Marks obtained by student. in java
Program to find SUM AND PRODUCT of a given Digit in java
Program to Find Factorial of Given no. in java
Program to Reverse a given no. in java
Program to find Fibonacci series of a given no in java
Program to find sum of all integers greater than 100 in java
Program to Concatenate string using for Loop in java

Related References
java - the equality and relational operators
java - bitwise and bit shift operators
html buttons
automatic type promotion in expressions
arithmetic operators
what are bit-wise operators? how are they used in java?
assignment operator in java
what are boolean logical operators in java?
ternary operators in java
what are relational operators in java? how are they used?
operator precedence in java
java constructors
usage of finalize() method in java
java - overloading constructors
how to install java

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