Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Simple Calendar C language     - Ubuntu 14.04.1 LTS compile and install the new kernel (Linux)

- Linux System Getting Started Learning: Disable HTTP forwarding wget in (Linux)

- Windows and Ubuntu dual system, repair of two ways UEFI boot (Linux)

- DataGuard a hardware issue warnings found (Database)

- CentOS 7 hard disk expansion toss record (Linux)

- Use Swift remove the spaces in the string (Programming)

- The most common and most effective security settings under linux (Linux)

- iTerm - let your command line can also be colorful (Linux)

- Java loop list to solve the problem of Joseph ring (Programming)

- HTML5 postMessage cross-domain data exchange (Programming)

- How to create a bootable USB disk to use MultiSystem on Ubuntu (Linux)

- Hibernate in profile (Database)

- The user how to install Notepadqq 0.41.0 under ubuntu and debian (Linux)

- Use MongoDB C # MongoDB official driving operation (Database)

- Linux terminal interface font color settings (Linux)

- VMware virtual machine operating system log Error in the RPC receive loop resolve (Linux)

- Fun music library in Linux using command line (Linux)

- Ubuntu users how to install the latest Nvidia graphics drivers (Linux)

- Bash difference in single quotes and double quotes (Programming)

- Bash How to read a file line by line (Programming)

 
         
  Simple Calendar C language
     
  Add Date : 2018-11-21      
         
         
         
  Using C language simple calendar, as follows:

#include < stdio.h>

int main (int argc, const char * argv []) {

    // Insert code here ..

    int year, month, day = 0, day1 = 0;

    printf ( "Please enter the year:");

    scanf ( "% d", & year);

    printf ( "Please enter the month:");

    scanf ( "% d", & month);

    printf ( "a \ t two \ t three \ t four \ t five \ t six \ t date \ n");

    // Judgment year is a leap year or this leap year

    for (int i = 1900; i
        if ((i% 4 == 0 && i% 100! = 0) || i% 400 == 0) {

            day = day + 366;

        } Else {

            day = day + 365;

        }

    }

   

    // Analyzing month

    for (int m = 1; m <= month; m ++) {

        switch (m) {

            case 4: case 6: case 9: case 11:

                day1 = 30;

                break;

            case 2:

                if ((year% 4 == 0 && year% 100! = 0) || year% 400 == 0) {

                    day1 = 29;

                } Else {

                    day1 = 28;

                }

                break;

            default:

                day1 = 31;

                break;

        }

        if (m
        day = day + day1;

        }

    }

    int t;

    t = day% 7;

  // Determine the first day of the month is the day of the week

    for (int i = 0; i
        printf ( "\ t");

    }

    // Format control

    for (int i = 1; i <= day1; i ++) {

        printf ( "% d \ t", i);

        if ((i + day)% 7 == 0) {

            printf ( "\ n");

        }

    }

    printf ( "\ n \ n");

    return 0;

   

}
     
         
         
         
  More:      
 
- Oracle Character Set Summary (Database)
- Elasticsearch 2.20 Beginners: aggregation (Server)
- Linux NFS FTP use (Server)
- After VMware CentOS full VM clone the network card is unavailable Solutions (Linux)
- Linux System Getting Started Tutorial: How to Force Change your password at next logon Linux (Linux)
- Loop arrays in C language is not easy to find a bug (Programming)
- 4 lvcreate example commonly used commands (Linux)
- MySQL 5.6.26 source install (Database)
- CentOS6.5 setup Oracle 11gR2 startup (Database)
- Java memory-mapped file MappedByteBuffer (Programming)
- Summarize small problems encountered in the use Lua (Programming)
- How to Check notebook CPU temperature in Ubuntu (Linux)
- Linux - use chroot command (Linux)
- Create a custom pixel format based on an existing image data BufferedImage (Programming)
- java.net.NoRouteToHostException of Hadoop problem: no route to host (Server)
- quotacheck command file can not be created aquota.user and aquota.group solutions (Linux)
- How to properly set up a Linux swap partition (Linux)
- SSH without password (Linux)
- RHEL5 stalled due to power service error system can not start (Linux)
- How to Install Node.js in CentOS 7 (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.