Template by:
Free Blog Templates

Showing posts with label Pattern. Show all posts
Showing posts with label Pattern. Show all posts

Wednesday, September 30, 2009

Write programs to print Numerical & Symbolic Patterns using C

 WAP to print the following numerical patterns

1)
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
2)
!
!  !
!  !  !
!  !  !  !..upto n
3)
*
*  *
*  *  *
*  *  *  *.. upto n
4)
1
1  2
1  2  3
1  2  3  4..upto n
5)
1
2  2
3  3  3
4  4  4  4..upto n 
6)
             *
         *  *
     *  *  *
 *  *  *  *..upto n
7)
             1

         2  1

     3  2  1

 4  3  2  1..upto n
8)
             1

         2  2

     3  3  3

 4  4  4  4..upto n



Click here to see solutions

Write programs to print alphabatical patterns using C

1) WAP to print the following pattern
A
A B
A B C
A B C D
prog:
#include"stdio.h"
#include"conio.h"
void main()
{
char i, j;
clrscr();
for(i='A'; i<='D'; i++)
{
for(j='A'; j<=i; j++)
{
printf("%c ", j);
}
printf("\n ");
}
getch();
}