6.2.5 Formating string outputs print()

odt

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

145 X6485

Subject

Computer Science

Date

Dec 6, 2023

Type

odt

Pages

1

Uploaded by Ryanjordanl

Report
PARTICIPATION acTviTY Use myString belo String myString Testing”; 1) printf("%4s", myString); Testing’ 4 B2 oo 2) printf("%8s", myString); Testing’ B3 oo 3) printf("%.4s", myString); Test 4 4) printf("%.10s", myString); Testing 4 B2 oo 5) printf("%-8s123", myString); Testing 123 4 6.2.5: Formatting string outputs using print to determine the output from the print statements. Note: correct answers will be shown with quotations to denote string output and to show spacing. Correct Testing widith are printed St nger than the spe without truncation. Correct *Testing’ Strings shorter than the specified width are printed with Testing” requires 7 characters, so 1 space is as padding Correct Test' is longer than the specified precision and is t0 4 char Correct Testing" A maximum of 10 characters can be printed, but ing” has only 7 characters, Correct “Testing 123" characters, 5o the 7 characters of put followed by 1 space as padding. The adding after the string,
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help