solutions
solutions
any 4.
# Example usage
print(find_largest(5, 3)) # Output: 5
36. Logical operators with examples:
AND: Returns true if both conditions are true.
o Example: True and False gives False.
part D any 4
to its complexity.
o Microcontroller: More cost-effective for
dedicated tasks.
Question 40: Explain ASCII number system.
Answer: The ASCII (American Standard Code for
Information Interchange) number system is a character
encoding standard used to represent text in computers and
electronic devices. Each character (letters, digits,
symbols) is assigned a unique 7-bit binary code, ranging
from 0 to 127.
Example:
o A has an ASCII code of 65 (binary: 1000001).
# Swapping
a = a + b
b = a - b
a = a - b
print("After swapping:")
print("First number:", a)
print("Second number:", b)
Explanation:
1. The program takes two numbers as input.
2. It adds a and b and assigns the result to a.
3. Then it calculates b as a - b, which results in the
original value of a.
4. Finally, it calculates a as a - b, resulting in the
original value of b.
5. This successfully swaps a and b without using any
extra variable.