-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.c
More file actions
95 lines (86 loc) · 2.08 KB
/
Copy pathmain.c
File metadata and controls
95 lines (86 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// display hello world on the computer screen
// 1. Hello world
#include <stdio.h>// header file . GNU
//int main(){
// printf("Hello, World!");
// return 0;
//}
// 2. data types
/*
* 1. int 7 8 9 100 10000
* 2. float 3.145
* 3. double 100000004432.433
* 4. char "A" "0"
*
* sizeof()
*/
//#include <stdio.h>
//
//int main() {
// // to get the length t of each type (how many bits it costs in the memory)
//
// /*
// * %d it is format specifier. digit
// */
// printf("size of int %d\n", sizeof(int));
// printf("size of float %d\n",sizeof(float));
// printf("size of double %d\n",sizeof(double ));
// printf("size of char %d\n",sizeof(char));
//}
// 3. variables
// variable : a variable is a name for an area in memory
//#include <stdio.h>
//int main(){
// //1 . first declare then initialize.
// int age;
// age = 18;
// //2 . declare and initialize at the same time.
// int score = 90;
//}
//4. constants
// constant is somewhere in memory, in which the value can't be changed.
//#include <stdio.h>
//# define PI 3.14
//int main() {
// // 1. using const keyword, it will save the value on the memory.
// // const double PI=3.14; // this will be in the memory.
// // 2. using macro, macro will not save the value on memory, but just replaces everywhere when we need it .
//}
//5. input and output
// 5.2
//#include <stdio.h>
//int main(){
// char a=getchar();
// printf("%c\n",a);
// return 0;
//}
//int main(){
// char a[5];
// gets(a);
// printf("%s\n",a);
// return 0;
////}
//#include <stdio.h>
//int main(){
// int age;
// scanf("%d",&age);
// printf("Mr Azat is %d years old! Owwa\n",age);
// return 0;
//}
#include <stdio.h>
//int main(){
// float length,width;
// printf("Hey, enter fucking info:");
// scanf("%f %f",&length, &width);
// printf("The are of ur fucking rec is %f m\n",length*width);
//}
// out put
//int main() {
// int x;
// float num;
// char text[20];
// scanf("%d %f %s", &x, &num, text);
// printf("%d\n %f\n %s\n",x,num,text);
// return 0;
//}
// %[*][max][d]