O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Review Questions

You'll find answers to the review questions in Appendix A, “Answers to Review Questions.”

1:Run Listing 4.1 again, but this time give your first and last name when it asks you for your first name. What happens? Why?
2:Assuming that each of the following examples is part of a complete program, what will each one print?
  1. printf("He sold the painting for $%2.2f.\n", 2.345e2);

  2. printf("%c%c%c\n", 'H', 105, '\41');

  3. #define Q "His Hamlet was funny without being vulgar."
    printf("%s\nhas %d characters.\n", Q, strlen(Q));
    
  4. printf("Is %2.2e the same as %2.2f?\n", 1201.0, 1201.0);

3:In Question 2c, what changes could you make so that string Q is printed out enclosed in double quotation marks?
4:It's find the error time!
 define B booboo define ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required