Program CS
Program CS
5,10,9.
-> a = 5
print(a)
a=a*2
print(a)
a=a-1
print(a)
OUTPUT
5
10
9
2) Write a program that accepts the radius of
circle and displays area of circle .
-> from math import pi
r = float(input ("Input the radius of the circle : "))
print ("The area of the circle with radius " + str(r) + "
is: " + str(pi * r**2))
Output :
Input the radius of the circle : 1.1
The area of the circle with radius 1.1 is:
3.8013271108436504
Flowchart :
3) Write program to find out print whether a
given character is an upper case or lower case
or digit or any other character .
-> ch=(input("enter a character"))
if(ch>='A' and ch<='Z'):
print("The Given Character is an Uppercase
Alphabet")
elif(ch>='a' and ch<='z'):
print("The Given Character is a Lowercase
Alphabet")
elif(ch>='0' and ch<='9'):
print("The Given Character is a digit")
else:
print("Given Character special character")
Output :
enter a character : 9
The Given Character is a digit