fork download
  1. /* printf example */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main()
  6. {
  7. printf ("Characters: %c %c \n\t", 'a', 7);
  8. printf ("Decimals: %d %ld\n", 1977, 650000L);
  9. printf ("Preceding with blanks: %10d \n", 1977);
  10. printf ("Preceding with zeros: %010d \n", 1977);
  11. printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100);
  12. printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
  13. printf ("Width trick: %*d \n", 5, 10);
  14. printf ("%s \n", "A string");
  15. system("pause");
  16. return 0;
  17. }
Success #stdin #stdout #stderr 0s 2112KB
stdin
Standard input is empty
stdout
Characters: a  
	Decimals: 1977 650000
Preceding with blanks:       1977 
Preceding with zeros: 0000001977 
Some different radixes: 100 64 144 0x64 0144 
floats: 3.14 +3e+00 3.141600E+00 
Width trick:    10 
A string 
stderr
sh: 1: pause: not found