title: C - Pattern Printing within a Switch Menu
body: <p>I am new with C but have to do a project for school. I want to print out a menu in which the user selects a pattern which then gets printed out. It should be something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/MWyoj.jpg" rel="nofollow noreferrer">Program running</a></p>
  
  <p>But as you can see when I select the pattern for a second time it does not show the pattern. It only shows a blank space. Here is my code so far:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      int numerodefilas;
  
      printf("Ingrese la cantidad de filas/longitud del objeto:\n");
      scanf("%d", &amp;numerodefilas);
  
      int fila, columna, eleccion;
      int numerodecolumnas = numerodefilas;   
  
      do {
          printf("1: Triangulo\n");
          printf("2: Piramide\n");
          printf("\nSalir\n");
          scanf("%d", &amp;eleccion);
  
          switch (eleccion) {
          case 1:
              for (fila = 1; fila &lt;= numerodefilas; fila++) {
                  for (columna = 1; columna &lt;= numerodecolumnas; columna++) {
                      printf("X");
                  }
                  printf("\n");
                  numerodecolumnas--;
              }
              break;
          case 2: /* Second choice */
              break;
          case 3:
              system("cls");
              printf("Adios!\n");
              break;
          default:
              printf("No seleccionaste una opción correcta!");
              break;
          }
      } while (eleccion != 3);
  
      system("PAUSE");
      return 0;
  }
  </code></pre>
  
  <p>The identifiers are in spanish, since I have to do it in spanish. Just a quick explanation about the names:</p>
  
  <ol>
  <li>numerodefilas = numberoflines</li>
  <li>numerodecolumnas = numberofcolumns</li>
  <li>fila = line</li>
  <li>columna = column</li>
  <li>eleccion = choice</li>
  <li>"Ingrese la cantidad de filas/longitud del objeto" = Enter the amount of lines/longitud of the object"</li>
  <li>Triangulo = Triangle</li>
  <li>Piramide = Pyramide</li>
  <li>Adio = Bye</li>
  </ol>
  
  <p>I don't know if somebody can still help me? If you need more explanations just let me know! Am I doing something wrong? Is there something wrong with the pattern printing? I would really appreciate any help at all.</p>