fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double pi = 3.1415926;
  5. int n = 123;
  6. char symbol = 'A';
  7.  
  8. printf("|%d| \n", n); // |123|
  9. printf("|%2d| \n", n); // |123|
  10. printf("|%5d| \n", n); // | 123|
  11. printf("|%12d| \n\n", n); // | 123|
  12.  
  13. printf("|%f| \n", pi); // |3.1415926|
  14. printf("|%5f| \n", pi); // |3.1415926|
  15. printf("|%12f| \n\n", pi); // | 3.1415926|
  16.  
  17. printf("|%c| \n", symbol); // |A|
  18. printf("|%5c| \n", symbol); // | A|
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
|123| 
|123| 
|  123| 
|         123| 

|3.141593| 
|3.141593| 
|    3.141593| 

|A| 
|    A|