Vous êtes sur la page 1sur 9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

Togglenavigation

Scanftree.com

MCQ
CProgramming
AcademicTutorials
Automata
DataStructure
OS
GraphTheory
Microprocessor
DatabaseConcept
DBMS
SQL
SQLite
ProgrammingTutorials
C
C#
Python
Programs
C
JAVA
C++
Python
Extra
Css/HtmlMaker
CheatSheets
SEO
IFSCCodes

Search

AlgorithmImplementation
Array
Conversion
Datastructure
DateandTime
DecisionandLoops
DynamicAllocation
FileHandling
FrequentlyAskedCprogramsininterview
Graphics
MathematicalPrograms
Matrix
Miscellaneous
MyFirstProgram
Networking
NumberPrograms
Patterns
Pointer
Recursion
Searching
Series
Sorting
String
Swapping

http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

1/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

PrintPatternsinC:part1
Levelsofdifficulty:Hard/performoperation: Patterns
cprogramtoprintpatternsofnumbersandstars
PatternsPart1
PatternsPart2
PatternsPart3
PatternsPart4
PatternsPart5

Output:1
*****
*****
*****
*****
*****_

Program:1
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j;

clrscr();

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

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

printf("*");

printf("\n");

getch();
}

Output:2
*
**
***
****
*****_

http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

2/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

Program:2
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j;

clrscr();

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

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

printf("*");

printf("\n");

getch();
}

Output:3
*
**
***
****
*****_

Program:3
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j,k;

clrscr();

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

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

printf("");

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

printf("*");

printf("\n");

getch();
}

Output:4

http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

3/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

*****
****
***
**
*_

Program:4
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j,k,samp=1;

clrscr();

for(i=5;i>=1;i){

for(k=samp;k>=0;k){

printf("");

//only1space

for(j=i;j>=1;j){

printf("*");

samp=samp+1;

printf("\n");

getch();
}

Output:5
*****
****
***
**
*_

Program:5
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j;

clrscr();

for(i=5;i>=1;i){

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

printf("*");

printf("\n");

getch();
}

http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

4/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

Output:6
*
**
***
****
*****_

Program:6
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j,k,t=0;

clrscr();

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

for(k=t;k<5;k++){

printf("");

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

printf("*");

t=t+1;

printf("\n");

getch();
}

Output:7
*
**
***
****
*****
****
***
**
*_

Program:7
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j,k,samp=1;

clrscr();

for(i=1;i<=5;i++){
http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

5/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

for(k=samp;k<=5;k++){

printf("");

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

printf("*");

samp=samp+1;

printf("\n");
}
samp=1;
for(i=4;i>=1;i){

for(k=samp;k>=0;k){

printf("");

for(j=i;j>=1;j){

printf("*");

samp=samp+1;

printf("\n");
}
getch();

Output:8
Enternumberofrows:5
1
23
456
78910
1112131415_

Program:8
#include<stdio.h>
#include<conio.h>
voidmain(){

intrw,c,no=1,len;

clrscr();

printf("Enternumberofrows:");

scanf("%d,"&len);

for(rw=1;rw<=len;rw++){

printf("\n");

for(c=1;c<=rw;c++){

printf("%2d",no);

no++;

getch();
}

http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

6/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

Output:9
Enternumberofrows:5
0
101
21012
3210123
432101234
54321012345_

Program:9
#include<stdio.h>
#include<conio.h>
voidmain(){

intno,i,y,x=35;

clrscr();

printf("Enternumberofrows:");

scanf("%d,"&no);

for(y=0;y<=no;y++){

goto(x,y+1);

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

printf("%3d",abs(i));

x=x3;

getch();
}

Output:10
1
22
333
4444
55555_

Program:10
#include<stdio.h>
#include<conio.h>
voidmain(){

inti,j=5,k,x;

clrscr();

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

for(k=1;k<=j;k++){

printf("");
http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

7/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

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

printf("%d",i);

printf("");

printf("\n");

j=j1;
}
getch();

OtherRelatedProgramsinc
1.PrintPatternsinC:part5
2.PrintPatternsinC:part4
3.PrintPatternsinC:part3
4.PrintPatternsinC:part2
5.PrintPatternsinC:part1
6.WriteacprogramforFloydstriangle
7.WriteacprogramtoprintPascaltriangle

http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

8/9

10/17/2016

PrintPatternsinC:part1|Basic,medium,expertprogramsexampleinc,java,c/++

scanftreeisoptimizedforlearning,testing.Examplesmightbesimplifiedtoimprovereadingandbasic
understanding.Tutorials,references,andexamplesareconstantlyreviewedtoavoiderrors,butwecannotwarrant
fullcorrectnessofallcontent.
Copyright2016scanftree.com

http://scanftree.com/programs/c/programstoprintpyramidpatternsincpart1/

9/9