CIS126 Unit 5 Discussion.docx - Unit 5 Discussion Formatting I\/O Sorry for the lateness I decided on the program D The code prints each character in the
CIS126 Unit 5 Discussion.docx - Unit 5 Discussion...
100%(3)3 out of 3 people found this document helpful
This preview shows page 1 - 3 out of 3 pages.
Unit 5 Discussion: Formatting I/OSorry for the lateness, I decided on the program D.The code prints each character in the array in different lines. The output would be a string outputusing the character array.HAPPYBIRTDAYThis output is managed by a format specifier in the printf statement.Format specifier: "\t%c \n"\t - refer to tab character%c - a single character" " (space) - whitespace character\n - new line
In the code, we iterate through each character in the array and print them using the formatspecifier. In the new code#include <stdio.h>int main(void) {puts("String output using character array");char h[] = "Happy Birthday";
You've reached the end of your free preview.
Want to read all 3 pages?
Spring '20
Character encoding,ASCII,#include,printf,Whitespace