Example : Write a program in C to print as the given pattern using nesting of loop concept .

#include<stdio.h>
#include<conio.h>
void main()
{
	int i,j;
        clrscr();
	for(i=1;i<=5;i++)
	{
		for(j=1;j<=i;j++)
		{
		    printf("*");
		}
		printf("\n");		
	}
       getch();
}

Example : Write a program in C to print the given pattern using heterogeneous nesting of loop concept.

#include<stdio.h>
#include<conio.h>
void main()
{
	int i,j,k;
        clrscr();
	k=1;
	for(i=1;i<=5;i++)
	{
		j=1;
		while(j<=5)
		{
			printf("%d\t",k);
			k=k+1;
                        j++;
		}
		printf("\n");
		k=1;
	}
        getch();
}

Example : Write a program in C to print the given pattern using nesting of loop concept .

#include<stdio.h>
#include<conio.h>
void main()
{
   int i,j,k=1;
   clrscr();	
   for(i=1;i<=4;i++)
    {
     for(j=1;j<=5;j++)
       {
	  printf("%d  ",k);
	  k=k+1;
       }
       printf("\n");
    }
    getch();
}

Example : Write a program in C to print the given pattern using nesting of loop concept .

#include<stdio.h>
#include<conio.h>
void main()
{
	int i,j,k;
        clrscr();
	k=15;
	for(i=1;i<=3;i++)
	{
		for(j=15;j>=11;j--)
		{
			printf("%d\t",k);
			k=k-1;
		}
		printf("\n");		
	}
        getch();
}

Example : Write a program in C to print the given pattern using nesting of loop concept .

#include<stdio.h>
#include<conio.h>
void main()
{
  int i,j,k=1;
  clrscr();
  for(i=1;i<=5;i++)
    {
      for(j=1;j<=i;j++)
        {
          printf("%d  ",k);
        }
        printf("n");
        k=k+1;
    }
  getch();
}

Example : Write a program in C to print the given pattern using nesting of loop concept .

#include<stdio.h>
#include<conio.h>
void main()
{
   int i,j;
   clrscr();
   for(i=1;i<=5;i++)
    {
       for(j=1;j<=i;j++)
	{
	  printf("%d ",j);
	}
	printf("\n");		
    }
    getch();
}

Example : Write a program in C to print the given pattern using nesting of loop concept .

#include<stdio.h>
#include<conio.h>
void main()
{
	int i,j;
        clrscr();
	for(i=1;i<=5;i++)
	{
		for(j=5;j>=i;j--)
		{
			printf("%d ",i);
		}
		printf("\n");
	}
	getch();
}

Example : Write a program in C to print the given pattern using nesting of loop concept .

#include<stdio.h>
#include<conio.h>
void main()
{
	int i,j;
        clrscr();
	for(i=1;i<=5;i++)
	{
	   for(j=5;j>=i;j--)
	     {
		   printf("%d ",j);
	     }
	     printf("\n");		
	}
	getch();
}

Example : Write a program in C to print the given pattern using nesting of loop concept .

#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("%d ",j);
		}
		printf("\n");	
	}
	getch();
}

 545 total views,  2 views today

Categories: C

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.