Advertisement
weldisalves

Lista 03 - exercício 40

Jun 17th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. //40. Desenhe a seguinte seqüência de triângulos. O usuário determina a quantidade de triângulos.
  4.  
  5. int main()
  6. {
  7.     int quantTri,i,j,k;
  8.  
  9.     printf("\n Digite a quantidade de Triangulos: ");
  10.     scanf("%d",&quantTri);
  11.  
  12.     for(k=1;k<=quantTri;k++)
  13.     {
  14.         for(i=1;i<=k;i++)
  15.         {
  16.             for(j=0;j<i;j++)
  17.             {
  18.                 printf(" * ");
  19.             }
  20.             printf("\n");
  21.         }
  22.         printf("\n");
  23.     }
  24.  
  25.     getchar();
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement