Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ C language print various graphic     - Oracle multi-user concurrency and transaction processing (Database)

- Why not use the ifconfig command under RedHat Linux 5 (Linux)

- Linux and hardware (Linux)

- ASM Disk Space Check (Database)

- Linux System Getting Started Learning: Using yum to download the RPM package without installing (Linux)

- MySQL concat function is SQL injection (Linux)

- Distributed File System FastDFS deployment (Server)

- How UTorrent download the ISO image from the command line (Linux)

- Linux with Windows Explorer as a security system (Linux)

- Installation on the way to the root source Ubuntu Server 14.04 LTS version Odoo8.0 (Server)

- Tip: Use Cryptsetup U disk encryption (Linux)

- How to Install Apache on Linux servers (Server)

- Use Bosh deploy CloudFoundry problems encountered on OpenStack (Server)

- Ubuntu 10.10 install Oracle 10g Installation Guide (Database)

- CentOS7 management of systemd (Linux)

- S5PV210 development board for embedded development environment to build under Ubuntu (Linux)

- How to use the ftp tool to transfer files between Windows and Linux (Linux)

- Ubuntu under VirtualBox virtual machine serial port settings (Linux)

- Replace font under Linux (Linux)

- Oracle lag () and lpad () function (Database)

 
         
  C language print various graphic
     
  Add Date : 2018-11-21      
         
         
         
  C language with a variety of graphics can be printed circulation

A right triangle (right standing): part of the code

  int i, j;
    for (i = 0; i <6; i ++) {
        for (j = 6; j> i; j--) {
            printf ( "");
        }
        for (j = 0; j <= i; j ++) {
            printf ( "*");
        }
        printf ( "\ n");
    }

There are a variety of right-angled triangle is not introduced one by one.

2. isosceles triangle (upright) part of the code is as follows:

int i, j;

for (i = 0; i <6; i ++) {

    for (j = 6; j> i; j--) {

        printf ( "");

    }

    for (j = 0; j <2 * i + 1; j ++) {

        printf ( "*");

    }

    printf ( "\ n");

}

Inverted isosceles triangle:

int i, j;

for (i = 0; i <6; i ++) {

    for (j = 0; j
        printf ( "");

    }

    for (j = 0; j <11-2 * i; j ++) {

        printf ( "*");

    }

   

    printf ( "\ n");

  }

3. diamond

Code:

int i, j, k;

for (i = 1; i <= 5; i ++) {

    for (j = 6; j> i; j -) {

        printf ( "");

    }

    for (k = 1; k <= 2 * i-1; k ++) {

        printf ( "*");

    }

    printf ( "\ n");

}

for (i = 1; i <= 6; i ++) {

        for (j = 1; j <= i-1; j ++) {

            printf ( "");

        }

        for (k = 1; k <= 13-2 * i; k ++) {

            printf ( "*");

        }

        printf ( "\ n");

        }

4. open triangles

Code:

int i, j;

for (i = 0; i <5; i ++) {

    for (j = 5; j> i; j--) {

        printf ( "");

    }

    for (j = 0; j <2 * i + 1; j ++) {

        if (j == 0 || j == 2 * i || i == 0 || i == 4) {

            printf ( "*");

        } Else {

            printf ( "");

        }

     

    }

    printf ( "\ n");

}

5. Hollow diamond: its principle and almost hollow triangle

Code is as follows:

int i, j;

for (i = 0; i <4; i ++) {

    for (j = 3; j> i; j--) {

        printf ( "");

    }

    for (j = 0; j <2 * i + 1; j ++) {

       

        if (j == 0 || j == 2 * i) {

            printf ( "*");

        } Else {

            printf ( "");

        }

    }

    printf ( "\ n");

}

for (i = 0; i <4; i ++) {

    for (j = 0; j
        printf ( "");

    }

    for (j = 0; j <7-2 * i; j ++) {

        if (j == 0 || j == 6-2 * i) {

            printf ( "*");

        } Else {

            printf ( "");

        }

    }

    printf ( "\ n");

}


6, Pine

Code is as follows:

// Christmas

  int i, j;

  for (i = 0; i <3; i ++) {

      for (j = 4; j> i; j--) {

          printf ( "");

      }

      for (j = 0; j <2 * i + 1; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <4; i ++) {

      for (j = 4; j> i; j--) {

          printf ( "");

      }

      for (j = 0; j <2 * i + 1; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <5; i ++) {

      for (j = 4; j> i; j--) {

          printf ( "");

      }

      for (j = 0; j <2 * i + 1; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <5; i ++) {

      for (j = 0; j <3; j ++) {

          printf ( "");

      }

      for (j = 0; j <3; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <2; i ++) {

      for (j = 0; j <10; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }
     
         
         
         
  More:      
 
- To modify the existing user ID and comments GPG key (Linux)
- Linux system last command usage (Linux)
- Getting Started with Linux system to learn: how to install the Shrew Soft IPsec VPN on Linux (Linux)
- C ++ 11 smart pointers (Programming)
- CentOS 6 rapid deployment of Java applications (Linux)
- CentOS 5.5 install ntop (Linux)
- CentOS / Linux install VNC Server (Linux)
- Spacewalk remove packages install the update (Linux)
- JQuery implements the same content merge cells (Programming)
- Java look and feel mode (Facade mode) (Programming)
- CentOS installed JDK8 (Linux)
- Let the terminal under Mac OS X as like Linux has displayed a variety of colors (Linux)
- Linux commands with browsing and downloading files (Linux)
- Linux based serial programming (Programming)
- Shell programming entry (Programming)
- Can not empty the Recycle Bin to repair problems in Ubuntu 14.04 (Linux)
- OpenNMS compile under Linux (Server)
- Linux processes in memory and memory cgroup statistics (Linux)
- Linux operating system security management skills notes (Linux)
- Compile and install GCC 4.8.1 + GDB 7.6.1 + Eclipse in CentOS 6.4 in (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.