Contact Learn C
Copy

Program 301: Program to Display Alpha Numeric Pattern

Program 301: Program to Display Alpha Numeric Pattern
 
//1
//AA
//222
//BBBB
//33333
#include<stdio.h>
main()
{
 int i,j,numCount=1,alphaCount=65,rows;
 printf("Enter Number of rows\n");
 scanf("%d",&rows);
 for(i=1;i<=rows;i++)
 {
  for(j=1;j<=i;j++)
  {
   if(i%2==1)
   {
    printf("%d",numCount);
   }
   else
   {
    printf("%c",alphaCount);
   }
  }
  if(i%2==1)
  numCount++;
  else
  alphaCount++;
  printf("\n");
 }
 
}
Explanation:

//Coming Soon...

Output:

Program to Display Alpha Numeric Pattern Output

Program to Display Alpha Numeric Pattern Output


No comments:

Post a Comment

Donate

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide