C Programming

C Programming


Floyd Algorithm Character Pattern In C

Posted: 05 Mar 2015 12:28 AM PST

Q. WAP (Write A Program) to making the floyd algorithm character pattern in C as:

  A
  BC
  DEF
  GHIJ
  KLMNO

Ans.

/*c program for floyd algorithm character pattern*/
#include<stdio.h>
int main()
{

 int n=5,x='A';
 char r,c;
 for(r='A'; n>=1; r++, n--)
 {
   for(c='A'; c<=r; c++, x++)
       printf("%c", x);
   printf("\n");
 }
 getch();
 return 0;
}

/************************************************************
The output of above program would be:
*************************************************************/

Output of Floyd Algorithm Character Pattern In C
Figure: Screen shot for Floyd Algorithm Character Pattern In C


Your might also like:

  1. Floyd Algorithm Number Pattern In C
  2. Big List of 98+ C Pyramid Programs
  3. Latest Pyramid Programs list asked by user


Post a Comment