In this class, I learned about the basic output function to print the context (e.g., numbers, characters, symbols).
In order to output numbers, symbols, etc., it can be used in parentheses of printf().
Remember to always put a semicolon at the end of the code.
1. Text
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
printf("My name is \n Filbert");
return 0;
}
If a line change is required within the written text, it should be added "\n".
2. Number
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
printf("%d", 12345");
return 0;
}
3. Characters
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
printf(" * \n");
printf(" *** \n");
printf("*****\n");
return 0;
}
'Study Meeting > 빡공단 30기' 카테고리의 다른 글
[Day 6] ASCII Code: How to represent letter in C Language? (1) | 2023.01.07 |
---|---|
[Day 5] Standard input/output functions: scanf() and printf() (0) | 2023.01.05 |
[Day 4] Character variable : To represent a character type (0) | 2023.01.04 |
[Day 3] Numeric variables : To represent a number type (0) | 2023.01.03 |
[Day 1] Print "Hello C World" for confirming the IDE settings (0) | 2023.01.01 |