Advertisement
whitesurge

CompE C Tips

Aug 30th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. http://socialledge.com/sjsu/index.php/Main_Page
  2.  
  3. Withing the Printf use %d to call variable(int) you state later.
  4.  
  5. Ex) printf("The Variable is %d /n", x)
  6.  
  7. Ex) scanf("%d", &y)
  8.  
  9.  
  10. Float is %f
  11. Decimal is %d
  12. Char is %c
  13. String is %s
  14. double is a variable type (containing decimals
  15.  
  16.  
  17. if (m==0)
  18.  
  19. Do this;
  20.  
  21. else
  22.  
  23. Do this;
  24.  
  25. \n (newline)
  26. \t (tab)
  27. \v (vertical tab)
  28. \f (new page)
  29. \b (backspace)
  30. \r (carriage return)
  31. \n (newline)
  32. %d (print as a decimal integer)
  33. %lf (to call a double)
  34. %6d (print as a decimal integer with a width of at least 6 wide)
  35. %f (print as a floating point)
  36. %4f (print as a floating point with a width of at least 4 wide)
  37. %.4f (print as a floating point with a precision of four characters after the decimal point)
  38. %3.2f (print as a floating point at least 3 wide and a precision of 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement