fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. char str[11] = " ";// Filled with 10 blank spaces
  6. int i=0;
  7. while(i < 5)
  8. {
  9. str[9 - 2*i] = (i+1) + 48;// +48 will give equivalent ASCII code
  10. printf("%s\n",str);
  11. i++;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
         1
       2 1
     3 2 1
   4 3 2 1
 5 4 3 2 1