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.  
  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 ",i);
  22.  
  23. }
  24. printf("\n");
  25.  
  26. }
  27.  
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 5316KB
stdin
5
stdout
Enter the rows: 
1 
A B 
3 3 3 
A B C D 
5 5 5 5 5