-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcs121driver1.cpp
More file actions
47 lines (35 loc) · 1.8 KB
/
cs121driver1.cpp
File metadata and controls
47 lines (35 loc) · 1.8 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
/*****************************************************************************************
** File name : CS121_Lab1
**
** This program prints 'Waz up ? \n'
**
**
**
** Programmer : Trey Davis
**
** Date created : 9/18/2023
**
** Date last revised :
**
**
**
**
*****************************************************************************************/
#include <iostream>
using namespace std;
int main()
{
cout << "Waz up ? \n" << std::endl;
cout << "We are computing bits and bytes of the primitive data types \n ";
cout << endl <<endl;
cout << "Number of bytes in a short integer = " << sizeof(short) << "; number of bits" << sizeof(short) * 8 << "\n\n";
cout << "Number of bytes in an unsigned short integer = " << sizeof(unsigned short) << "; number of bits = " << sizeof(unsigned short) * 8 << "\n\n";
cout << "Number of bytes in an integer = " << sizeof(int) << "; number of bits = " << sizeof(int) * 8 << "\n\n";
cout << "Number of bytes in an unsigned integer = " << sizeof(unsigned int) << "; number of bits = " << sizeof(unsigned int) * 8 << "\n\n";
cout << "Number of bytes in an long integer = " << sizeof(long) << "; number of bits = " << sizeof(long) * 8 << "\n\n";
cout << "Number of bytes in an unsigned long = " << sizeof(unsigned long) << "; number of bits = " << sizeof(unsigned long) * 8 << "\n\n";
cout << "Number of bytes in an character = " << sizeof(char) << "; number of bits = " << sizeof(char) * 8 << "\n\n";
cout << "Number of bytes in an float = " << sizeof(float) << "; number of bits = " << sizeof(float) * 8 << "\n\n";
cout << "Number of bytes in an double = " << sizeof(double) << "; number of bits = " << sizeof(double) * 8 << "\n\n";
return 0;
}