Posts

Showing posts from January, 2025

Python

1 program:  int(input("Enter a number:")) i = 1   while i <= 10: print(num, " x " i, "=" num * i) i = i + 1 Pgm2 a = int(input("Enter the first number: "))  b = int(input("Enter the second number: ")) print("Before swapping: a =",a,",b=",b)  temp = a  a = b  b = temp  print("After swapping: a =", a, ", b =" , b) Pgm3 Program 3 l=flot(input ("enter the length of the rectangle:")) w=float(input("enter the width of the rectangle:")) perimeter=2*(l+w) are=l*w print("perimeter of the rectangle:", perimeter) Print("area of the rectangle:",area)