fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n;
  5. printf("Enter the number: \n");
  6. scanf("%d",&n);
  7. int a=1;
  8. for(int i=1;i<=n;i++){
  9.  
  10. for(int j=1;j<=i;j++){
  11.  
  12. printf(" %d ",a);
  13. a=a+2;
  14.  
  15. }
  16. printf("\n");
  17.  
  18. }
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0.01s 5288KB
stdin
10
stdout
Enter the number: 
 1 
 3  5 
 7  9  11 
 13  15  17  19 
 21  23  25  27  29 
 31  33  35  37  39  41 
 43  45  47  49  51  53  55 
 57  59  61  63  65  67  69  71 
 73  75  77  79  81  83  85  87  89 
 91  93  95  97  99  101  103  105  107  109