1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Basic calendar for beginners

Discussion in 'C, C++, C#' started by fatjack'sblackhat, Oct 1, 2013.

  1. fatjack'sblackhat

    fatjack'sblackhat Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 16, 2008
    Messages:
    611
    Likes Received:
    129
    Occupation:
    college student
    Location:
    Florida
    I am a beginner and Im taking Intro to c right now at the university of central florida. This is a simple calendar I learned about a week ago. Im sharing it with you all to help those who are struggling with the concept of nested for loops:
    Code:
    #include<stdio.h>
    #include<stdlib.h>
    
    
    int main(void)
    {
        int i, n, s;
        
        printf("What day do you want your month to start?<A number>\n");
        scanf("%d", &s);
        
        printf("How many days are in the month?\n");
        scanf("%d", &n);
        
        printf("_S_M_T_W_T_F_S_\n");
        
        for(i=1; i<=n; i++)
        {
                            
                
                if(i>9)
                printf("%d", i);
                
                else
                printf(" %d", i);
                
                if((i+s-1%7)==0)
                printf("\n");
                
        }
        
        getchar();
        while(getchar()!='\n')
        return 0;
    }
     
  2. lancis

    lancis Elite Member

    Joined:
    Jul 31, 2010
    Messages:
    1,632
    Likes Received:
    2,384
    Occupation:
    Entrepreneur
    Location:
    Milky Way
    Home Page:
    Funny.
    Check the C++ course page on the University of Central Florida website.

    http://www.ce.ucf.edu/Program/3118/Introduction-To-C-Programming/

    Its full of spun fake student reviews. For example:

     
    • Thanks Thanks x 3
  3. fatjack'sblackhat

    fatjack'sblackhat Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 16, 2008
    Messages:
    611
    Likes Received:
    129
    Occupation:
    college student
    Location:
    Florida
    I can tell you I was NOT comfortable with the material starting out. LOL that is hilarious that UCF has fake reviews
     
  4. bartosimpsonio

    bartosimpsonio Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 21, 2013
    Messages:
    8,911
    Likes Received:
    7,510
    Occupation:
    ZLinky2Buy SEO Services
    Location:
    ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
    Home Page:
    It seems like no place is immune from fake reviews these days.

    If running linux, go to your comman line and type in cal

    Nice little standard text-based calendar similar to yours.
     
  5. Logician

    Logician BANNED BANNED

    Joined:
    Apr 4, 2013
    Messages:
    584
    Likes Received:
    581
    Ha thats crazy they have fake reviews.

    OP keep this thread updated on your learning success. I've been thinking about taking a close on this too.
     
  6. royserpa

    royserpa Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 28, 2011
    Messages:
    4,650
    Likes Received:
    3,494
    Gender:
    Male
    Occupation:
    Negative Options aka Rebills!
    Location:
    Royserpa
    Home Page:
    OP, you can search arund bhw as there has been some dude sharing already coded scripts.

    If I remember well, there are many calendar like scripts