-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01-Variables.c
More file actions
32 lines (25 loc) · 813 Bytes
/
Copy path01-Variables.c
File metadata and controls
32 lines (25 loc) · 813 Bytes
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
#include<stdio.h>
int main(){
// Declaring Variables
int i = 5;
char c = 'A';
float f = 3.14;
double d = 6.6 / 100;
// printing Values
printf("Int i : %d\n",i);
printf("Char c : %c\n",c);
printf("Float f : %f\n",f);
printf("Double d : %lf\n",d);
// Size of Variable
// Using %d because sizeof() gives integer as output
printf("Size of int: %d bytes\n",sizeof(int));
printf("Size of int: %d bytes\n",sizeof(char));
printf("Size of int: %d bytes\n",sizeof(float));
printf("Size of int: %d bytes\n",sizeof(double));
// Address of Variable
printf("Address of i: %p\n",&i);
printf("Address of c: %p\n",&c);
printf("Address of f: %p\n",&f);
printf("Address of d: %p\n",&d);
return 0;
}