Telaryon

Paralelogramma rajzolás

Mar 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4.     int i;
  5.     int j;
  6.     int M;
  7.     int N;
  8.  
  9.     printf("Enter columns: ");
  10.     scanf("%d", &M);
  11.     printf("Enter rows: ");
  12.     scanf("%d", &N);
  13.  
  14.     for(i=1; i<=M; i++)
  15.     {
  16.         for(j=1; j<=M - i; j++)
  17.         {
  18.             printf("   ");
  19.         }
  20.  
  21.         for(j=1; j<=N; j++)
  22.         {
  23.             printf(" * ");
  24.         }
  25.  
  26.         printf("\n");
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment