c c plus plus java

Saturday, September 10, 2011

C Program Read Days And Print In Month Week Day Format

Variables used

month-Month
year-Year
day-Day
r-No: days entered
rem-Remainder

Program


#include<stdio.h>
main()
{
int month ,day,year,r,rem;
printf("Enter the number of days");
scanf("%d",&r);
year=r/365;
rem=r%365;
month=rem/30;
day=rem%30;
printf("Year=%d Month=%d Days=%d ",year,month,day);
}
Posted by Blogger at 8:58 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: c program

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2012 (5)
    • ►  March (3)
    • ►  February (2)
  • ▼  2011 (24)
    • ►  December (3)
    • ►  October (3)
    • ▼  September (18)
      • Get Started Basic HTML TAGS
      • PHP Program Syntax
      • Create Database in PHP Mysql
      • Running a PHP Script
      • C Program To Add Two Matrices Using Function
      • C Program To Find Length Of A String
      • C Program To Multiply 2 Matrices
      • C Program To Find Factorial Of A Number Using Recu...
      • C Program To Solve A Quadratic Equation
      • C Program To Convert Decimal To Binary Octal And H...
      • C Program To Find All Prime Numbers From 1 To Infi...
      • An introduction to PHP - Some Basic HTML tags
      • Xampp Free Download And Installation
      • C Program Algorithm To Count Number Of Vowels Blan...
      • C Program For An Exponential Series
      • C Program Read Days And Print In Month Week Day Fo...
      • C Program To Implement Bubble Sort
      • C Program To Find Sum And Average Of N Numbers
Watermark theme. Powered by Blogger.