Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ELEC 1520

HW 1
Name:
Q1: What is bool variable in c++?
Bool variable is a primitive data type which can only store 2 values, true and
false.
Q2: What is a char?
char is also a primitive data type which can store 1 byte.
Q3: How many bytes are needed to store char?
1 byte
Q4: Difference between int and long?
Int is 4 bytes while long is8 bytes so it can store larger numbers.
Q5: How many bytes are used to store int?
Generally, 4 bytes
Q6: how many int variables can be store in 1MB?
1000000/4 = 250,000
Q7: 79 as binary?
0100 1111
Q8: numerical value of bool?
When bool is true numerical values is 1 and when it is false numerical value is 0
Q9: All c++ programs must contain?
Main function
Q10: What command ends the main?
Return statement.
Q11:
https://replit.com/join/cgreoblmko-espertraders

Q12:
https://replit.com/join/zgvwogbryy-espertraders

You might also like