Advertisement
makhon007

Floyed number

Nov 25th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.   int rows, i,  c, a = 1;
  6.  
  7.   printf("Enter the number of rows = ");
  8.   scanf("%d", &rows);
  9.  
  10.   for (i = 1; i <= rows; i++)
  11.   {
  12.     for (c = 1; c <= i; c++)
  13.     {
  14.       printf("%d ",a);
  15.       a++;
  16.     }
  17.     printf("\n");
  18.   }
  19.  
  20.   return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement