Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Mathematics ProgramRSS Feeds

PROGRAM TO CONVERT DAYS TO MONTHS AND DAYS

Posted By: Giovanna Silva     Category: C Programming     Views: 42550

WRITE A PROGRAM TO CONVERT DAYS TO MONTHS AND DAYS.

Code for PROGRAM TO CONVERT DAYS TO MONTHS AND DAYS in C Programming

main ()                                                      
   {                                                           
       int   months, days ;                                    
                                                               
       printf("Enter days\n") ;                                
       scanf("%d", &days) ;                                    
                                                               
       months = days / 30 ;                                    
       days   = days % 30 ;                                    
                                                               
       printf("Months = %d   Days = %d", months, days) ;       
   }                                                           
                                                               
                                                              
Output                                                      
                                                               
   Enter days                                                  
   265                                                         
   Months = 8   Days = 25                                      
                                                               
   Enter days                                                  
   364                                                         
   Months = 12   Days = 4                                      
                                                               
   Enter days                                                  
   45                                                          
   Months = 1   Days = 15                                      
  
Share: 


Didn't find what you were looking for? Find more on PROGRAM TO CONVERT DAYS TO MONTHS AND DAYS Or get search suggestion and latest updates.

Giovanna Silva
Giovanna Silva author of PROGRAM TO CONVERT DAYS TO MONTHS AND DAYS is from Salvador, Brazil.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!