-
September 10th, 2012, 09:55 AM
#1
Calendar prgram
please help me to finish my program
i must nd to make a calendar program that prompts the label of the day Mon to Sunday and the Month must change every call of the program ...please continue my code tnx im using DEV C++
/* 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
|