Professional Documents
Culture Documents
SIPAT, BILASPUR
(SESSION 2019-2020)
SUBMITTED BY:
CLASS XI , SCIENCE
SUBMITTED TO:
MRS. POOJA SINGH BAGHEL (C.S. TEACHER)
Q1. WRITE A PROGRAM TO ACCEPT TWO INTEGERS
AND PRINT THEIR SUM.
PROGRAM:
num1=int(input("Enter The First Number : "))
num2=int(input("Enter The Second Number : "))
print("Sum of",num1,"and",num2,"is",num1+num2)
OUTPUT:
Enter The First Number : 12
Enter The Second Number : 34
Sum of 12 and 34 is 46
PROGRAM:
length=float(input("Enter the Length of
Rectangle : "))
breadth=float(input("Enter the Breadth of
Rectangle : "))
print("Area of the Rectangle of
Length",length,"and
Breadth",breadth,"is",length*breadth)
OUTPUT:
Enter the Length of Rectangle : 56
Enter the Breadth of Rectangle : 14
Area of the Rectangle of Length 56.0 and
Breadth 14.0 is 784.0
Q3. WRITE A PROGRAM TO CHECK WHETHER THE
NUMBER IS EVEN OR ODD.
PROGRAM:
n=int(input("Enter the Number : "))
if n%2==0 :
print(n,"is Even Number.")
else :
print(n,"is Odd Number.")
OUTPUT:
Enter the Number : 5
5 is Odd Number.
PROGRAM:
a=input("Enter Your Name : ")
b=input("Enter Your Roll Number : ")
print("\nEnter Marks Out of 100\n")
sub1=float(input("Marks of Mathematics = "))
sub2=float(input("Marks of Physics = "))
sub3=float(input("Marks of Chemistry = "))
sub4=float(input("Marks of English = "))
sub5=float(input("Marks of Computer Science =
"))
per=((sub1+sub2+sub3+sub4+sub5)/500)*100
print("\nName :",a)
print("Roll No. :",b)
print("Your Percentage is",per,'%')
OUTPUT:
Enter Your Name : XYZ
Enter Your Roll Number : 12345
Marks of Mathematics = 97
Marks of Physics = 93
Marks of Chemistry = 90
Marks of English = 87
Marks of Computer Science = 99.9
Name : XYZ
Roll No. : 12345
Your Percentage is 93.38 %
PROGRAM:
num1=float(input("Enter First Number : "))
num2=float(input("Enter Second Number : "))
q=num1//num2
r=num1%num2
print("Quotient =",q)
print("Remainder =",r)
OUTPUT:
Enter First Number : 52
Enter Second Number : 30
Quotient = 1.0
Remainder = 22.0
PROGRAM:
n=int(input("Enter Your Age : "))
if n>=60 :
print("You are Senior Citizen.")
else :
print("You are Not Senior Citizen.")
OUTPUT:
Enter Your Age : 63
You are Senior Citizen.
PROGRAM:
s1=int(input("First Number : "))
s2=int(input("Second Number : "))
s3=int(input("Third Number : "))
if (s1<s2) and (s1<s3) :
print(s1,"is Lowest Number.")
elif (s2<s1) and (s2<s3) :
print(s2,"is Lowest Number.")
elif (s3<s1) and (s3<s2) :
print(s3,"is Lowest Number.")
OUTPUT:
First Number : 65
Second Number : 34
Third Number : 9
9 is Lowest Number.
PROGRAM:
for a in range(1,21) :
z=a**2
print("Square of",a,"=",z)
OUTPUT:
Square of 1 = 1
Square of 2 = 4
Square of 3 = 9
Square of 4 = 16
Square of 5 = 25
Square of 6 = 36
Square of 7 = 49
Square of 8 = 64
Square of 9 = 81
Square of 10 = 100
Square of 11 = 121
Square of 12 = 144
Square of 13 = 169
Square of 14 = 196
Square of 15 = 225
Square of 16 = 256
Square of 17 = 289
Square of 18 = 324
Square of 19 = 361
Square of 20 = 400
PROGRAM:
n=int(input("Enter A Number : "))
f=1
print("Factorial of",n,"=",end=' ')
for a in range(n,1,-1) :
f*=a
print(a,end=' x ')
print("1 =",f)
OUTPUT:
Enter A Number : 6
Factorial of 6 = 6 x 5 x 4 x 3 x 2 x 1 = 720
PROGRAM:
for a in range(100,9,-10) :
print(a,end=' ')
OUTPUT:
100 90 80 70 60 50 40 30 20 10
PROGRAM:
n=int(input("Enter A Number : "))
print("10 Multiples of",n)
for a in range(1,11) :
print(n*a,end=' ')
OUTPUT:
Enter A Number : 5
10 Multiples of 5
5 10 15 20 25 30 35 40 45 50
OUTPUT:
Value of a : 5
Value of b : 6
Value of c : 1
Roots are -1.0 and -0.2
Q13. WRITE A PROGRAM USING IF/ELSE STATEMENT
TO INPUT TWO OPERANDS AND ONE OPERATOR AND
PERFORM ARITHMETIC CALCULATIONS.
PROGRAM:
n1=float(input("Enter First Number : "))
n2=float(input("Enter Second Number : "))
c=input('''Select Operator
a. Addition
b. Subtraction
c. Multiplication
d. Division
e. Floor Division
f. Exponent
g. Modulus
Selection : ''')
if c=='a' :
print(n1+n2)
elif c=='b' :
print(n1-n2)
elif c=='c' :
print(n1*n2)
elif c=='d' :
print(n1/n2)
elif c=='e' :
print(n1//n2)
elif c=='f' :
print(n1**n2)
elif c=='g' :
print(n1%n2)
else :
print("Invalid Choice!")
OUTPUT:
Enter First Number : 2
Enter Second Number : 3
Select Operator
a. Addition
b. Subtraction
c. Multiplication
d. Division
e. Floor Division
f. Exponent
g. Modulus
Selection : f
8.0
Q14. WRITE A PROGRAM TO PRINT FIBONACCI
SERIES 0 1 1 2 3 5 8 . . . . .
PROGRAM:
a=0
b=1
n=int(input("Enter No. of Terms : "))
print(a,b,sep=' ',end=' ')
for x in range(0,n-2) :
c=a+b
print(c,end=' ')
a,b=b,c
OUTPUT:
Enter No. of Terms : 7
0 1 1 2 3 5 8
PROGRAM:
a='*'
for x in range(1,4) :
print(a*x)
OUTPUT:
*
* *
* * *
PROGRAM:
v=['a','e','i','o','u']
V=['A','E','I','O','U']
n=input("Enter a Character : ")
if (n in v) or (n in V) :
print(n,"is Vowel.")
else :
print(n,"is Not Vowel.")
OUTPUT:
Enter a Character : A
A is Vowel.
Q17. WRITE A MENU DRIVEN PROGRAM TO
CALCULATE
AREA OF CIRCLE
AREA OF SQUARE
AREA OF RECTANGLE
PROGRAM:
z=input('''Select Choice
a. Area of Circle.
b. Area of Square.
c. Area of Rectangle.
Selection : ''')
if z=='a' :
r=float(input("Enter Radius : "))
a=(22/7)*(r**2)
print("Area Of Circle of
radius",r,"is",a)
elif z=='b' :
s=float(input("Enter Side : "))
a=s*s
print("Area Of Square of Side",s,"is",a)
elif z=='c' :
l=float(input("Enter Length : "))
b=float(input("Enter Breadth : "))
a=l*b
print("Area Of Rectangle of
Length",l,"and Breadth",b,"is",a)
else :
print("Invalid Choice!")
OUTPUT:
Select Choice
a. Area of Circle.
b. Area of Square.
c. Area of Rectangle.
Selection : a
Enter Radius : 7
Area Of Circle of radius 7.0 is 154.0
PROGRAM:
n=int(input("Enter a Year : "))
if (n%4==0) :
if (n%100==0) :
if (n%400==0) :
print(n,"is Leap Year.")
else :
print(n,"is not Leap Year.")
else :
print(n,"is Leap Year.")
else :
print(n,"is not Leap Year.")
OUTPUT:
Enter a Year : 2020
2020 is Leap Year.
PROGRAM:
n=int(input("Enter a Number : "))
c=0
for a in range(1,n) :
if n%a==0 :
c+=a
if c==n :
print(n,"is a Perfect Number.")
else :
print(n,"is not a Perfect Number.")
OUTPUT:
Enter a Number : 6
6 is a Perfect Number.
PROGRAM:
n=int(input("Enter the Number : "))
n=str(n)
c='9'
for a in range(0,len(n)) :
if int(n[a])<c :
c=int(n[a])
print("The Smallest Digit Of The
Number",n,"is",c)
OUTPUT:
Enter the Number : 1452540
The Smallest Digit Of The Number 1452540 is 0
SQL QUERIES
TABLE : Employee
Empno Name dept Desig Salary
Aryan
Varun
Atul
finance
Marketing
Sales
5. SELECT EMPNO, NAME FROM EMPLOYEE;
Empno Name
1123 Komal
1256 Aryan
1766 Chhaya
1199 Varun
3465 Kunal
4560 Atul
finance 30000
Marketing 62000
Sales 44000
Aryan
Atul
Chhaya
Komal
Kunal
Varun
clerk
manager