Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » Forum » x-Forum » Question

help w/ important code-CppBuzz-Forum

i'm working on a program to receive a word of 6 letters max. then organise it like this.
exemple: (ps.: just used - to organise the words the way i want)
--------------------Test
---------------Test Test
----------Test Test Test
-----Test Test Test Test
Test Test Test Test Test

all that i've got atm is the reverse of this, could som1 help me with this code?
thanks!!

[code]
#include<stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

main()
{
  int x, y, size;

  char name[6];

  printf("Type a word: ");

  gets(name);
  size = strlen(name);

  for (x = 1; x <= size; x++)
  {
    for (y = 1; y <= x; y++)

      printf("%s\t", name);

    printf("\n");
  }

  return 0;
}
[/code]

Posted by oxypult 2020-11-22 22:22:04

No Ans Posted

Please login to comment

Log In


Ask New Question