In this class, I learned how to express numeric variables and constants (long long, double, float, etc.) in numerical types, and received two numbers as int and double variables to practice quadratic operations.
1. Types of Variables
- Integer: short, int, long, long long, and so on
ex) int A = 100
- Real Number: float, double, double long, and so on
ex) float A = 1.2
#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[]) {
int A;
A = 123;
printf("%d", A);
double B;
B = 123.123;
printf("%f", B);
return 0;
}
2. Practice for dealing with Quadratic operations
#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[]) {
int A;
A = 123;
printf("%d", A);
double B;
B = 123.123;
printf("%f", B);
printf("%f", A+B);
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 2] Output function in C language: printf() (0) | 2023.01.02 |
[Day 1] Print "Hello C World" for confirming the IDE settings (0) | 2023.01.01 |