This document contains homework solutions for various dates. It discusses questions on compilers vs interpreters, ASCII tables, 32-bit vs 64-bit CPUs, variable naming conventions, associativity and precedence. Further questions cover using cin and cout in if statements, full and inverted pyramid patterns, C being a high-level language, C++ reserved keywords, short data type overflow, and ternary operators.
This document contains homework solutions for various dates. It discusses questions on compilers vs interpreters, ASCII tables, 32-bit vs 64-bit CPUs, variable naming conventions, associativity and precedence. Further questions cover using cin and cout in if statements, full and inverted pyramid patterns, C being a high-level language, C++ reserved keywords, short data type overflow, and ternary operators.
This document contains homework solutions for various dates. It discusses questions on compilers vs interpreters, ASCII tables, 32-bit vs 64-bit CPUs, variable naming conventions, associativity and precedence. Further questions cover using cin and cout in if statements, full and inverted pyramid patterns, C being a high-level language, C++ reserved keywords, short data type overflow, and ternary operators.
This document contains homework solutions for various dates. It discusses questions on compilers vs interpreters, ASCII tables, 32-bit vs 64-bit CPUs, variable naming conventions, associativity and precedence. Further questions cover using cin and cout in if statements, full and inverted pyramid patterns, C being a high-level language, C++ reserved keywords, short data type overflow, and ternary operators.
Q1. What is the difference between compiler and interpreter?
Ans1.
Q2. What is ASCII Table?
Ans2. Q3. What is the difference between 32-bit and 64-bit CPU?
Q4. Explore various naming conventions of naming a variable.
Q5. Explore the associativity and precedence table.
29th January 2023 (Homework Solutions) Q1. What will happen if we use cin inside the if as a condition? Ans1.
Q2. What will happen if we use cout inside the if as a condition?
Q3. Write a code to make Full Pyramid Pattern. Ans3. Stars will be printed the same way as was done in the half pyramid pattern.
Q4. Write a code to make Inverted Full Pyramid Pattern.
1st February 2023 Q1. Is C a high level, middle level or low-level language? Explain. Ans1.
Q2. What are reserved keywords in C++?
Q3. As we know that short takes 2 bytes of memory which is equivalent to 16 bits and the maximum number it can store is 2^16 – 1 which is equal to 65535 but what happens if we add 65535 and it becomes 65545 and then stored in short? What will be the output?