BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 1st semester > Object Oriented Programming


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-03-2011, 12:04 AM
bonfire's Avatar
M.Arsalan Qureshi

 
Join Date: Oct 2008
Location: Garden Town, Multan Cantt
Posts: 616
Program / Discipline: BSTS
Class Roll Number: 09-31
bonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond repute
Default Program to convert days into years and weeks

Program to convert days into years and weeks


#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
int days,years,weeks,num1;
cout << "Enter the number of days : " << endl;
cin>>days;
years=days/365;
num1=days-(years*365);
weeks=days/7;
num1=days-(weeks*7);
cout << days << " days = " << endl;
cout << weeks << " weeks OR " << endl;
cout << years << " years." << endl;
getch();
}
This program takes in the number of days days as a screen input from the user.
It then converts the days into years as well as weeks and outputs it using the 'cout' command.



Sample Input
789
Sample Output
789 days =
112 weeks OR
2 years.

__________________

Reply With Quote
Reply

Tags
convert, days, program, weeks, years


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to convert temperatures from Celsius to Fahrenheit and vice versa bonfire Object Oriented Programming 0 09-03-2011 12:20 AM
Program to find the total days in the year till date bonfire Object Oriented Programming 0 09-03-2011 12:06 AM
Program to convert 2-digit octal number into binary number and print it bonfire Object Oriented Programming 0 09-03-2011 12:03 AM
LLB 3 years program 4th merit list bzu 2010 Salman Mushtaq University News and Events 0 29-09-2010 06:03 PM
LLB 5 years program 3rd merit list bzu 2010 Salman Mushtaq University News and Events 0 27-09-2010 11:30 AM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 08:07 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.