Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ C language print various graphic     - Samba file sharing server set up (Server)

- JEdit 5.2 Pro Edition installation on Ubuntu 14.04 (Linux)

- MySQL restart process can not be taken lightly (Database)

- Django1.5 Custom User Model (Programming)

- OpenJDK 7 compiled under Ubuntu 14.04.3 64-bit (Linux)

- Remove old kernel on Ubuntu (Linux)

- Java8 Lambda expressions and flow operations (Programming)

- MySQL view (Database)

- Use top to monitor the remote server (Server)

- Java implementation file encryption and decryption (Programming)

- TL-WR703N to install OpenWrt process notes (Linux)

- CentOS install Java 1.8 (Linux)

- MariaDB phpMyAdmin installation and configuration issues to resolve under CentOS7 (Database)

- PCM audio under Linux (Linux)

- When a software RAID data recovery and reconstruction of how failure (Linux)

- SSH keys using login and password to log prohibited practice (Linux)

- Ubuntu 10.10 install Oracle 10g graphic tutorials (Database)

- php performance monitoring module XHProf (Linux)

- Increase Linux system security --chattr (Linux)

- Install Debian Linux with R on the Android system (Linux)

 
         
  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:      
 
- Source code compiled by the installation program under Linux (Linux)
- Oracle 11g RMAN cross-platform transfer table space (Database)
- 11G ASM disk group does not automatically handle MOUNT (Database)
- How to install the latest version of the Eclipse in Ubuntu 14.04 (Linux)
- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)
- Compression decompression command under Linux (Linux)
- Household use Linux Security (Linux)
- QBit development of micro-services (Server)
- C ++ Supplements - locates the new expression (Programming)
- Linux modify the network interface name (Linux)
- Why you can have JavaScript string method (Programming)
- CentOS directory structure Explanation (Linux)
- To build PHP environment (Nginx + MariaDB + PHP7) under CentOS 6.5 (Server)
- Crawl use Wireshark packet on remote Linux (Linux)
- Normal start Lazarus 1.0.8 under Ubuntu (Linux)
- Compile and install LNMP under CentOS 6.5 (Server)
- Linux System Getting Started Learning: Change the name of the network interface on CentOS7 (Linux)
- Install Krita 2.8 on Ubuntu 13.10 / 12.04 / 12.10 (Linux)
- Large site architecture study notes (Server)
- Zabbix system email alert Python script (Server)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.