C Programming Code To Create Pyramid and Pattern
Examples to print half pyramid, pyramid, inverted pyramid, Pascal's Triangle and Floyd's triangle in C Programming using control statements. Read - Programming language To understand this example, you should have the knowledge of following C programming topics: C if, if...else and Nested if...else Statement C Programming for Loop C Programming while and do...while Loop C Programming break and continue Statement Programs to print triangles using *, numbers and characters Example 1: Program to print half pyramid using * * * * * * * * * * * * * * * * Source Code #include <stdio.h> int main () { int i , j , rows ; printf ( "Enter number of rows: " ); scanf ( "%d" ,& rows ); for ( i = 1 ; i <= rows ; ++ i ) { for ( j = 1 ; j <= i ; ++ j ) { printf ( "* " ); } printf ( "\n" ); } return ...