Q.1 Create
variables to store your name, age, height, and student status. Print their
values and data types.
Q.2 Assign
two integer variables and one float variable. Perform addition and print the
result.
Q.3 Take an integer
input from the user, convert it to a float, and display both values.
Q.4 Take a float number from the user and convert it into
an integer. Print the result.
Q.5 Take a number as
input (string type) and convert it into an integer, then add 10 and display the
result.
Q.6 Ask the user to
enter their name and age, then print a message like:
"Hello Rahul, you are 20 years old."
Q.7 Take two numbers
as input from the user and print their sum, difference, product, and division.
Q.8 Take two numbers
from the user and display:
- Remainder
using %
- Power
using **
Q.9 Write a program to
calculate the area of a rectangle using user input for length and width.
Q.10 Initialize a
variable with value 10. Use += to add 5 and print the result.
Q.11 Initialize a
variable with value 20. Use -= to subtract 8 and print the final value.
Q.12 Create a variable
with value 4. Use *= and then /= operators sequentially and print the results.

0 Comments:
Post a Comment