Program to Print Alphabet Pattern in C

In c language you can print any Alphabet Pattern. Here i will show you how to print Alphabet Pattern in c language with explanation.

Print Alphabet Pattern Program in C




#include<stdio.h>

void main()
{
char s[]="india";
int i,j;
for(i=0;s[i];i++)
{
for(j=0;j<=i;j++)
printf("%c",s[j]);
printf("\n");
}
getch();
}



Output:


  I
  IN
  IND
  INDI
  INDIA




#include <stdio.h>

int main()
{
    char s[50];
    int i,j;
    printf("Enter any string:");
    gets(s);
    for(i=0;s[i];i++)
   {
   for(j=0;j<=i;j++)
   printf("%c",s[j]);
   printf("\n");
   }
    return 0;
}




Output:


Enter any string:india
i
in
ind
indi
india

Process returned 0 (0x0)   execution time : 4.333 s


Enter size of triangle:27

Total alpha bits 26 only and you enter number is not correct..




Instagram