SlideShare a Scribd company logo
1 of 12
*
* *
* * *
* * * *
* * * * *_
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j;
clrscr();
for(i=0; i<5; i++)
{
for(j=0; j<=i; j++)
{
printf(" * ");
}
printf("n");
}
getch();
}
*
* *
* * *
* * * *
* * * * *_
#include <stdio.h>
#include <conio.h>
void main()
{
int i,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();
}
* * * * *
* * * *
* * *
* *
*_
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j,k,samp=1;
clrscr();
for(i=5; i>=1; i--)
{
for(k=samp; k>=0; k--)
{
printf(" "); // only 1 space
}
for(j=i; j>=1; j--)
{
printf("*");
}
samp = samp + 1;
printf("n");
}
getch();
}
* * * * *
* * * *
* * *
* *
*_
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j;
clrscr();
for(i=5; i>=1; i--)
{
for(j=1; j<=i; j++)
{
printf(" * ");
}
printf("n");
}
getch();
}
*
* *
* * *
* * * *
* * * * *_#include <stdio.h>
#include <conio.h>
void main()
{
int i,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();
}
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*_
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j,k,samp=1;
clrscr();
for(i=1; i<=5; i++)
{
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();
}
Enter number of rows: 5
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15_
#include <stdio.h>
#include <conio.h>
void main()
{
int rw, c, no=1 ,len;
clrscr();
printf("Enter number of rows: ");
scanf("%d," &len);
for(rw=1; rw<=len; rw++)
{
printf("n");
for(c=1; c<=rw; c++)
{
printf(" %2d ", no);
no++;
}
}
getch();
}
Enter number of rows: 5
0
1 0 1
2 1 0 1 2
3 2 1 0 1 2 3
4 3 2 1 0 1 2 3 4
5 4 3 2 1 0 1 2 3 4 5_
#include <stdio.h>
#include <conio.h>
void main()
{
int no,i,y,x=35;
clrscr();
printf("Enter number of rows: ");
scanf("%d," &no);
for(y=0;y<=no;y++)
{
goto(x,y+1);
for(i=0-y; i<=y; i++)
{
printf(" %3d ", abs(i));
x=x-3;
}
}
getch();
}
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5_
#include <stdio.h>
#include <conio.h>
void main()
{
int i, j=5, k, x;
clrscr();
for(i=1;i<=5;i++)
{
for(k=1;k<=j;k++)
{
printf(" ");
}
for(x=1;x<=i;x++)
{
printf("%d",i);
printf(" ");
}
printf("n");
j=j-1;
}
getch();
}
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5_
#include <stdio.h>
#include <conio.h>
void main()
{
int rw,c,no,spc;
clrscr();
printf("Enter number of rows : ");
scanf("%d", &no);
for(rw=1; rw<=no; rw++)
{
for(spc=no; spc>=rw; spc--)
{
printf(" ");}
for(c=1; c<=rw; c++)
{
printf("%2d",c);
}
printf("n");
}
getch();
}
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9_
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1; i<=5; i++)
{
for(j=1; j<=5-i; j++)
{
printf(" ");
}
for(k=1; k<=2*i-1; k++)
{
printf(" %d ",k);
}
printf("n");
}
getch();
}
A B C D E F G G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A_
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j,asci,spc;
clrscr();
for(i=7; i>=1; i--)
{
for(spc=6; spc>=i; spc--)
{
printf(" ");
}
asci=65;
for(j=1; j<=i; j++)
{
printf("%2c",asci++);
}
for(j=i-1; j>=0; j--)
{
printf("%2c",--asci);
}
printf("n");
}
getch();
}
AAA AAB AAC ABA ABB ABC ACA ACB ACC BAA BAB BAC BBA BBB
BBC BCA BCB BCC CAA CAB CAC CBA CBB CBC CCA CCB CCC_
#include <stdio.h>
#include <conio.h>
void main()
{
char ch1, ch2, ch3;
clrscr();
for(ch1='A' ; ch1<='C' ; ++ch1)
{
for(ch2='A' ; ch2<='C' ; ++ch2)
{
for(ch3='A' ; ch3<='C' ; ++ch3)
{
printf(" %c%c%c", ch1, ch2, ch3);
}
}
}
getch();
}

More Related Content

What's hot (20)

C Program : Sorting : Bubble,
C Program : Sorting : Bubble, C Program : Sorting : Bubble,
C Program : Sorting : Bubble,
 
Dsa 1
Dsa 1Dsa 1
Dsa 1
 
08 1 함수란
08 1 함수란08 1 함수란
08 1 함수란
 
07 4 for반복문
07 4 for반복문07 4 for반복문
07 4 for반복문
 
Novatadas en java
Novatadas en javaNovatadas en java
Novatadas en java
 
Alprog
AlprogAlprog
Alprog
 
listing output program C
listing output program Clisting output program C
listing output program C
 
Info clasa
Info clasaInfo clasa
Info clasa
 
12 2 문자열 응용
12 2 문자열 응용12 2 문자열 응용
12 2 문자열 응용
 
Lector
LectorLector
Lector
 
Doi xung mang mot chieu
Doi xung mang mot chieuDoi xung mang mot chieu
Doi xung mang mot chieu
 
Fcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt ChartFcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt Chart
 
Prueba de montecarlo
Prueba de montecarloPrueba de montecarlo
Prueba de montecarlo
 
07 3 do-while반복문
07 3 do-while반복문07 3 do-while반복문
07 3 do-while반복문
 
Daniel snake
Daniel snakeDaniel snake
Daniel snake
 
N primo clase programa
N primo clase programaN primo clase programa
N primo clase programa
 
programs
programs programs
programs
 
Quick sort
Quick sortQuick sort
Quick sort
 
C language program
C language programC language program
C language program
 
Introduction to TDD in C
Introduction to TDD in CIntroduction to TDD in C
Introduction to TDD in C
 

Viewers also liked

Madri Gras Gathering of 2 12-13
Madri Gras Gathering of 2 12-13Madri Gras Gathering of 2 12-13
Madri Gras Gathering of 2 12-13shagmiser
 
Presentation business management
Presentation business managementPresentation business management
Presentation business managementsakura rena
 
Celebrate International Women's Day 2013 with Bioversity International
Celebrate International Women's Day 2013 with Bioversity InternationalCelebrate International Women's Day 2013 with Bioversity International
Celebrate International Women's Day 2013 with Bioversity InternationalBioversity International
 
콘텐츠 산업 미래 대응
콘텐츠 산업 미래 대응콘텐츠 산업 미래 대응
콘텐츠 산업 미래 대응Kim jeehyun
 
Penyampaian bad news (komunikas bisnis)
Penyampaian bad news (komunikas bisnis)Penyampaian bad news (komunikas bisnis)
Penyampaian bad news (komunikas bisnis)Puw Elroy
 

Viewers also liked (8)

Madri Gras Gathering of 2 12-13
Madri Gras Gathering of 2 12-13Madri Gras Gathering of 2 12-13
Madri Gras Gathering of 2 12-13
 
Report week 3
Report week 3Report week 3
Report week 3
 
Presentation business management
Presentation business managementPresentation business management
Presentation business management
 
Gimp
GimpGimp
Gimp
 
Triple salto
Triple saltoTriple salto
Triple salto
 
Celebrate International Women's Day 2013 with Bioversity International
Celebrate International Women's Day 2013 with Bioversity InternationalCelebrate International Women's Day 2013 with Bioversity International
Celebrate International Women's Day 2013 with Bioversity International
 
콘텐츠 산업 미래 대응
콘텐츠 산업 미래 대응콘텐츠 산업 미래 대응
콘텐츠 산업 미래 대응
 
Penyampaian bad news (komunikas bisnis)
Penyampaian bad news (komunikas bisnis)Penyampaian bad news (komunikas bisnis)
Penyampaian bad news (komunikas bisnis)
 

More from Future Programming

More from Future Programming (7)

Measures of central tendency
Measures of central tendencyMeasures of central tendency
Measures of central tendency
 
Java control flow statements
Java control flow statementsJava control flow statements
Java control flow statements
 
Osi model in networking
Osi model in networkingOsi model in networking
Osi model in networking
 
Osi model in networking
Osi model in networkingOsi model in networking
Osi model in networking
 
Characteristics of tps
Characteristics of tpsCharacteristics of tps
Characteristics of tps
 
Network Topologies
Network TopologiesNetwork Topologies
Network Topologies
 
Transaction processing system future programming
Transaction processing system   future programmingTransaction processing system   future programming
Transaction processing system future programming
 

C - Pattern - Code - [Future Programming]

  • 1. * * * * * * * * * * * * * * *_ #include <stdio.h> #include <conio.h> void main() { int i,j; clrscr(); for(i=0; i<5; i++) { for(j=0; j<=i; j++) { printf(" * "); } printf("n"); } getch(); } * * * * * * * * * * * * * * *_ #include <stdio.h> #include <conio.h>
  • 2. void main() { int i,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(); } * * * * * * * * * * * * * * *_ #include <stdio.h> #include <conio.h> void main() { int i,j,k,samp=1; clrscr(); for(i=5; i>=1; i--)
  • 3. { for(k=samp; k>=0; k--) { printf(" "); // only 1 space } for(j=i; j>=1; j--) { printf("*"); } samp = samp + 1; printf("n"); } getch(); } * * * * * * * * * * * * * * *_ #include <stdio.h> #include <conio.h> void main() { int i,j; clrscr(); for(i=5; i>=1; i--) { for(j=1; j<=i; j++) { printf(" * ");
  • 4. } printf("n"); } getch(); } * * * * * * * * * * * * * * *_#include <stdio.h> #include <conio.h> void main() { int i,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(); }
  • 5. * * * * * * * * * * * * * * * * * * * * * * * * *_ #include <stdio.h> #include <conio.h> void main() { int i,j,k,samp=1; clrscr(); for(i=1; i<=5; i++) { 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--)
  • 6. { for(k=samp; k>=0; k--) { printf(" "); } for(j=i; j>=1; j--) { printf("*"); } samp = samp + 1; printf("n"); } getch(); } Enter number of rows: 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15_ #include <stdio.h> #include <conio.h> void main() { int rw, c, no=1 ,len; clrscr(); printf("Enter number of rows: ");
  • 7. scanf("%d," &len); for(rw=1; rw<=len; rw++) { printf("n"); for(c=1; c<=rw; c++) { printf(" %2d ", no); no++; } } getch(); } Enter number of rows: 5 0 1 0 1 2 1 0 1 2 3 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 5 4 3 2 1 0 1 2 3 4 5_ #include <stdio.h> #include <conio.h> void main() { int no,i,y,x=35; clrscr(); printf("Enter number of rows: "); scanf("%d," &no);
  • 8. for(y=0;y<=no;y++) { goto(x,y+1); for(i=0-y; i<=y; i++) { printf(" %3d ", abs(i)); x=x-3; } } getch(); } 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5_ #include <stdio.h> #include <conio.h> void main() { int i, j=5, k, x; clrscr(); for(i=1;i<=5;i++) { for(k=1;k<=j;k++) { printf(" "); }
  • 9. for(x=1;x<=i;x++) { printf("%d",i); printf(" "); } printf("n"); j=j-1; } getch(); } 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5_ #include <stdio.h> #include <conio.h> void main() { int rw,c,no,spc; clrscr(); printf("Enter number of rows : "); scanf("%d", &no); for(rw=1; rw<=no; rw++) { for(spc=no; spc>=rw; spc--) { printf(" ");}
  • 10. for(c=1; c<=rw; c++) { printf("%2d",c); } printf("n"); } getch(); } 1 1 2 3 1 2 3 4 5 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 9_ #include <stdio.h> #include <conio.h> void main() { int i,j,k; clrscr(); for(i=1; i<=5; i++) { for(j=1; j<=5-i; j++) { printf(" "); } for(k=1; k<=2*i-1; k++) { printf(" %d ",k); } printf("n");
  • 11. } getch(); } A B C D E F G G F E D C B A A B C D E F F E D C B A A B C D E E D C B A A B C D D C B A A B C C B A A B B A A A_ #include <stdio.h> #include <conio.h> void main() { int i,j,asci,spc; clrscr(); for(i=7; i>=1; i--) { for(spc=6; spc>=i; spc--) { printf(" "); } asci=65; for(j=1; j<=i; j++) { printf("%2c",asci++); } for(j=i-1; j>=0; j--) { printf("%2c",--asci);
  • 12. } printf("n"); } getch(); } AAA AAB AAC ABA ABB ABC ACA ACB ACC BAA BAB BAC BBA BBB BBC BCA BCB BCC CAA CAB CAC CBA CBB CBC CCA CCB CCC_ #include <stdio.h> #include <conio.h> void main() { char ch1, ch2, ch3; clrscr(); for(ch1='A' ; ch1<='C' ; ++ch1) { for(ch2='A' ; ch2<='C' ; ++ch2) { for(ch3='A' ; ch3<='C' ; ++ch3) { printf(" %c%c%c", ch1, ch2, ch3); } } } getch(); }