Practice Problem 3
Basics
Question 1-1
What function is used in C to display a string on the screen?
Question 1-2
To use the above function, you must pass the manual to the compiler. State the pseudo-instruction for this purpose and the filename of the manual to be passed.
Question 1-3
To insert a line break when displaying text in the above function, you write the symbol.
What is the general term for that symbol?
What is the general term for that symbol?
Program reading
Question 2-1
#include <stdio.h>
int main(void)
{
printf("The pen is mightier\n than the sword\n");
return 0;
printf("Time is money\n");
}
Program documentation
Question 3-1
Create a program that displays the following on the screen.
Provided that the tops of the second characters are aligned, the number of spaces doesn't matter.
Intel : Pentium4
AMD : Athlon64
Provided that the tops of the second characters are aligned, the number of spaces doesn't matter.
Intel : Pentium4
AMD : Athlon64
Fundamentals (Answer Key)
Solution 1-1
printf function
While there are other options like puts, printf is the fundamental function.
Solution 1-2
Pseudo Command #include
FileName stdio.h
FileName stdio.h
It is also correct to use #include
Solution 1-3
Escape sequence
Program Reading (Solution Example)
Solution 2-1
The pen is mightier
than the sword
than the sword
Note that the function terminates with a return statement, so the last sentence will not be displayed.
Program Documentation (Example Solution)
Question 3-1
#include <stdio.h>
int main(void)
{
printf("Intel\t: Pentium4\n");
printf("AMD\t: Athlon64\n");
return 0;
}
You don't need to use spaces to align the text, but using tabs is easier.
Please be careful of the line break at the end, as even experienced writers can easily forget it.
About This Site
Learning C language through suffering (Kushi C) isThis is the definitive introduction to the C language.
It systematically explains the basic functions of the C language.
The quality is equal to or higher than commercially available books.




