-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program to Find the Size of a variable.php
71 lines (60 loc) · 2.08 KB
/
Program to Find the Size of a variable.php
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
<html>
<head>
<style> div.cd{background:teal;} a{text-decoration:none; color:white;} p{font-size:20;text-align:justify;} th:hover{background-color:black;} th{font-size: 20}
</style>
</head>
<body bgcolor="">
<div class="cd" style="color:white;font-size:50;width:100%;top:0;left:0;position:sticky;border: 1px solid black">
<table >
<tr> <td><img src="logo.png" width="100" height="100" style="padding-left:50" alt="loading.."></td>
<td> <font color="white" size="33" face="cooper" > Fast & Furious Logics </font> </td>
<form method="post" action="<?php $_PHP_SELF ?>">
<td align="right" style="padding-left:350;font-size:25">
<font color="white" face="cooper" > search <input type="text" name="search">
</font>
</td>
</form>
</tr>
</table>
</div>
<table >
<tr >
<td height="100%" valign="top">
<iframe src="links.php" height="520" style="overflow:scroll;top:0"></iframe>
</td>
<td valign="top" style="font-size: 20;font-family: cursive;" width="750">
<div style="overflow: scroll ; height:550;">
<h1>
Program to Find the Size of a variable
</h1>
<pre>
int main()
{
int integerType;
float floatType;
double doubleType;
char charType;
// Sizeof operator is used to evaluate the size of a variable
printf("Size of int: %ld bytes\n",sizeof(integerType));
printf("Size of float: %ld bytes\n",sizeof(floatType));
printf("Size of double: %ld bytes\n",sizeof(doubleType));
printf("Size of char: %ld byte\n",sizeof(charType));
return 0;
}
Output
Size of int: 4 bytes
Size of float: 4 bytes
Size of double: 8 bytes
Size of char: 1 byte
</pre>
In this program, 4 variables integerType, floatType, doubleType and charType are declared having int, float, double and char type respectively.
Then, the size of each variable is ascertained using sizeof operator.
</div>
</td>
<td valign="top">
<iframe src="comment.php" height="520"></iframe>
</td>
</tr>
</table>
</body>
</html>