Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- // If you want to use strings, use %s
- // Good for programs where users can enter their name
- printf("%s is the best person ever\n", "Bucky");
- // Use %d for integers
- printf("I ate %d corndogs at the fair\n", 9);
- // %f for numbers with decimal places (floating point values)
- // 6 decimal places by default
- printf("Pi is %f \n", 3.1415926535);
- printf("Pi is %.1f \n", 3.1415926535);
- printf("Pi is %.3f \n", 3.1415926535);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement