CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Calendar prgram

  1. #1
    Join Date
    Sep 2012
    Posts
    6

    Post 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

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: Calendar prgram

    [ Moved thread ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured