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:06 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 find the total days in the year till date

Program to find the total days in the year till date


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

void main()
{
clrscr();
int day,month,total;
int days_per_month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
cout << "Enter the month : " << endl;
cin>>month;
cout << "Enter the day : " << endl;
cin>>day;
total=day;
for(int x=0;x<month-1;x++)
total+=days_per_month[x];
cout << "The number of days in this year till date = " << total << endl;
getch();
}
This program takes in the current day and month as a screen input from the user.
It then calculates the total number of days in the current year till date and outputs it using the 'cout' command.
Sample Input
6
12
Sample Output
The number of days in this year till date = 163

__________________

Reply With Quote
Reply

Tags
date, days, find, program, till, total, year


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 days into years and weeks bonfire Object Oriented Programming 0 09-03-2011 12:04 AM
Program to find the sum of each row & column of a matrix of size n x m and if matrix is square, find the sum of the diagonals bonfire Object Oriented Programming 0 09-03-2011 12:01 AM
Program to enter an integer and find out if it is even or odd bonfire Object Oriented Programming 0 01-03-2011 03:08 PM
Program to enter an integer and print its total value based on the formula 'x - 1/3!x^3 + 1/5!x^5 - 1/7!x^7 + 1/9!x^9' bonfire Object Oriented Programming 0 28-02-2011 10:58 PM
11 year boy wrote story of his death two days before .BZU. Youtube Videos/Clips etc 3 11-12-2010 09:19 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 05:58 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.