NevLabs

Under Construction

NevLabs

Under Construction

NevLabs

Under Construction

NevLabs

Under Construction

NevLabs

Under Construction

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

Sunday, August 7, 2011

To generate pattern 333 22 1

#include<stdio.h>

void main()
{
int i,j,n;
clrscr();
printf("how many lines you need to print :");
scanf("%d",&n);
for(i=n;i>0;i--)
   {
   for(j=0;j<i;j++)
      {
      printf("%d",i);
      }
    printf("\n");
   }
getch();
}

To generate pattern 1 12 123

#include<stdio.h>

void main()
{
int i,j,n;
clrscr();
printf("how many lines you need to print :");
scanf("%d",&n);
for(i=0;i<n;i++)
   {
   for(j=0;j<=i;j++)
      {
      printf("%d",j+1);
      }
    printf("\n");
   }
getch();
}

To generate pattern 321 21 1


#include<stdio.h>

To generate pattern * ** ***


#include<stdio.h>

To generate pattern*** ** *


#include<stdio.h>

To generate pattern 1 12 123


#include<stdio.h>