String print pattern program

#include<stdio.h>
#include<string.h>
int main()
{
 char str[] = "SOFTETHICS";
 int len = strlen(str);
 int i,j;
 
 for(i=0;i<=len;i++)
 { 
  for(j=0;j<=len;j++)
  {
   if(i<=j)
    printf("%c",str[j]);
   else
    printf(" ");
  }
   printf("\n");
 }
 return 0;
}

Related Post

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.