fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. /*int n;
  5.   printf("Enter the columns: \n");
  6.   scanf("%d",&n);*/
  7. int m;
  8. printf("Enter the rows: \n");
  9. scanf("%d",&m);
  10.  
  11. for(int i=1;i<=m;i++){
  12. int a=65;
  13. int d=1;
  14. for(int j=1;j<=i;j++){
  15. if(i%2==0){
  16. char ch=(char)a;
  17. printf("%c ",ch);
  18. a++;
  19. }
  20. else{
  21. printf("%d ",d);
  22. } d++;
  23.  
  24. }
  25. printf("\n");
  26.  
  27. }
  28.  
  29.  
  30. return 0;
  31. }
  32.  
Success #stdin #stdout 0.01s 5324KB
stdin
5
stdout
Enter the rows: 
1 
A B 
1 2 3 
A B C D 
1 2 3 4 5