-
September 10th, 2012, 10:06 AM
#1
Calendar Proram in Dev C++ Please Help me to finish it
Good eve sir maam please help me to finish my calendar program
The code below is right but its not complete because the output dont have the label of the day monday to sunday and the label of the month is always November please help tnx !!!
/* Date Written:
Author:
Purpose: Calendar Program converted to function with two parameter
*/
#include <cstdlib>
#include <iostream>
using namespace std;
// start of function def
int cal_one(int ed,int sc) // ed -ending date; sc - starting col(days of the week),
{
printf ("\tNovember\n");
int row,col,dat=0, bc=sc; // bc=starting column
for (row=0;row<6;row++)
{
for (int sp=0; sp < sc; sp++) // loop that print a column space
printf(" ");
for (col=sc;col<7;col++)
{
dat = dat+1;
if (dat <= ed)
{
printf("%3d",dat);
}
}
sc=0;
printf("\n");
}
}
// end of function definition
main()
// start of main program
{
cal_one(28,6); // call the function named cal_one
printf("\n\n");
system("PAUSE");
cal_one(30,3); // call function for the 2nd time
printf("\n\n");
system("PAUSE");
cal_one(31,2); // call function for the 3rd time
printf("\n\n");
system("PAUSE");
return EXIT_SUCCESS;
// end of main program
}
// eof
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|