Skip to main content

Posts

Showing posts from June, 2019

Pattern programming

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. List of Source Code Code to print triangles using *, digits and characters Code to print inverted triangles using * and digits Code to print full pyramids Code to print Pascal's triangle Code to print Floyd's triangle 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" ); } retur...