Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ C language print various graphic     - Oracle 11g manually create a database (Database)

- Linux environment to build next Cocos2dx-3.3.1 (Linux)

- Install Visual Studio Code in Ubuntu (Linux)

- Btrfs file system repair techniques (Linux)

- The compiler installed Kaldi under Ubuntu 12.04 (Linux)

- MySQL server after an unexpected power outage can not start (Database)

- Linux CPU Monitoring Index (Linux)

- ethtool command Detailed (Linux)

- Ubuntu 14.04 install Nmap 6.46.1 (Linux)

- Source encountered problems and solutions when installing SaltStack (Server)

- Java NIO in the world (Programming)

- Installation through the network Debian 7 (Wheezy) (Linux)

- Python image processing library (PIL) to install and simple to use (Linux)

- Nginx configuration support f4v video format player (Server)

- Using Linux strace command trace / debug a program commonly used options (Linux)

- Ubuntu Server security risk checks (Linux)

- Linux how to view the graphics models notebook (Linux)

- Ubuntu install OpenMPI (Linux)

- PostgreSQL 9.4.3 Installation and Configuration under CentOS 6.5 (Database)

- Windows environment Android Studio v1.0 Installation Guide (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:      
 
- CentOS installed JDK8 (Linux)
- Linux shell script under the use of randomly generated passwords (Programming)
- Oracle 11g dataguard main library backup and recovery to the test environment in one database error (Database)
- Ubuntu 14.04 LTS installed Hadoop 1.2.1 (distributed cluster mode) (Server)
- Camouflage Nginx Web server version to prevent invasion (Linux)
- File SUID, SGID, Sticky property (Linux)
- Service manager OpenBSD on rccl (Server)
- Using packet capture libpcap be reconciliation package in Ubuntu 14.04 64 bits (Linux)
- Migu online music player for Linux (Linux)
- C language - Traverse pci device (Programming)
- How LUKS encrypted disk / partition to perform remote incremental backup (Linux)
- Linux data recovery software efficiently practical application extundelete (Linux)
- Encounter ORA-00600: internal error code, arguments: [4194] ORA-1552 (Database)
- C ++ casts New Standard Comments (Programming)
- wget command examples (Linux)
- Difference between TCP and UDP protocols (Linux)
- php security study (Linux)
- Ubuntu security settings and tools (Linux)
- VPN built on CentOS (Server)
- Oracle SQL statement tracking (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.