as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write a code to output a word pyramid from the word 'apple.'
user
#include <stdio.h>

int main()
{
  char str[20], temp;
  int len, i, j;

  printf("enter a word: ");
  scanf("%s", str);

  len = strlen(str);
  // looping to print each word per line 
  for (i=0; i<len; i++)
  {
     for (j=len; j > i; j--)
     {
        printf("%c", str[j]);
     }
     printf("\n");
  }
  return 0;
}

/*
output:
apple
pple
ple
le
e
*/
assistant