pTutorial

New way to learn C programming

C Program to Print Floyd's pattern

This is a used define c program to print Floyd's tringle pattern by using nested loop. Floyd's tringle is nothing, it just a right angle triangle using numbers as shown in below example.

Floyd's pattern



#include <stdio.h>
#include <conio.h>
void main()
{
   int n, i,  c, a = 1;
   printf("Print Floyd's  pattern program \n\n");
   printf("Please enter the number of row\n");
   scanf("%d",&n);
   for ( i = 1 ; i <= n ; i++ )
   {
      for ( c = 1 ; c <= i ; c++ )
      {
         printf("%d ",a);
         a++;
      }
      printf("\n");
   }
   printf("\nCreated by pTutorial.com");
   getch();
   
}

Download floyd's pattern

Output of program

C floyd's pattern

See Also

Php unset function   |   Php5 tutorial pdf   |   Java array exercises with solutions

QUOTES OF THE DAY

Impossible is a word only be found in the dictionary of fools.

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER