-
Notifications
You must be signed in to change notification settings - Fork 0
/
datatype.c
48 lines (35 loc) · 888 Bytes
/
datatype.c
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
// callde lap to use printf()
#include <stdio.h>
// Define to const Variable
#define PI 3.14
int main() {
/*
Data Type
int: integer, a whole number.
float: floating point, a number with a fractional part.
double: double-precision floating point value.
char: single character.
*/
printf("***Data Types****\n");
printf("int: %Id \n",sizeof(int));
printf("float: %Id \n",sizeof(float));
printf("double: %Id \n",sizeof(double));
printf("char: %ld \n",sizeof(char));
/* المتغيرات*/
printf("----Variables ---- \n");
int a , b ;
float salary = 56.23;
char letter = 'Z';
a = 8;
b = 34;
int c = a + b;
printf("c= %d \n",c);
printf("salary= %f \n",salary);
printf("letter= %c \n",letter);
// Constants
printf("****Constants ****\n");
const double pi = (3.141);
printf("const pi= %f \n",pi);
printf("define PI %f \n",PI);
return 0;
}