Beruflich Dokumente
Kultur Dokumente
SUBMITTED BY:
STUDENT NAME- ADESH RANJAN
ROLL NUMBER- BTECH/15115/18
BRANCH- ECE
SEMESTER- 4TH SEM (2ND YEAR)
MOBILE NO.-8210706330
EMAIL- adeshranjan99@gmail.com
1. Write the basic objective of IT Workshop.
The objective of IT workshop is to impact basic
computer usage and maintenance skill and introduce to
a suite of productivity tolls that will aid in day-to-day
activities.IT workshop works in learning-by-doing
mode.IT concentrates more on hand-on experience for
the participant rather theoretical classes. The IT
workshop prepare the participant to have a hand-on
exercise in maintaining and troubleshooting a PC by
themselves.
val1= 8;
val2= 4;
addition= val1+val2;
multiplication= val1*val2;
division= val1/val2;
OUTPUT:
val1= 8
val2= 4
addition= 12
subtraction=4
multiplication= 32
division=2
4.Write a program to find addition ,subtraction,
multiplication and division by inputting value of variables.
1.Addition program:
sum= x + y
OUTPUT:
x=12
y=14
sum= 26
2.Subtraction program:
x=input(‘Enter first value’)
sub=x – y
OUTPUT:
x=12
y=14
sub= -2
3.Multiplication program:
mul= x *y
OUTPUT:
y=14
mul=168
4.Division program:
div= x /y
OUTPUT:
x=12
y=14
div= 0.8571
5.Write a program to find root of a quadratic equation.
a= input(‘Enter a: ‘);
b=input(‘Enter b: ‘);
c=input(‘Enter c: ‘);
D= b^2 -4*a*c;
if D<0
elseif D==0
root= -b/(2*a);
fprintf(‘%.3f ‘,root)
else
r1=(-b+ sqrt(D))/(2*a);
r2=(-b –sqrt(D))/(2*a);
OR
a= roots(p)
OUTPUT:
a=3
b=-2
c=-4
r1=1.5352
r2= - 0.8685
OR
a= 1.5352
-0.8685
p=[ ];
for r= 1:n
end
a=roots(p)
OR
a= input(‘Enter a: ‘);
b=input(‘Enter b: ‘);
c=input(‘Enter c: ‘);
d= input(‘Enter d: ‘);
p=[ a b c d];
r=root(p)
OUTPUT:
n =3
p= 2 4 5
a=
-1.0000+1.2247i
-1.0000-1.2247i
OUTPUT:
A= 1.1615e+ 04
P= 5000;
r = 5;
t= 10;
OUTPUT:
f= @(R)plot(R*cos(0:.001:2*pi),R*sin(0:.001:2*pi));
f(4)
axis equal
OUTPUT:
10.Write a program to plot a graph for sin^2x +
cos^2x=1.
plot((cos(-1:0.01:1)).^2+(sin(-1:0.01:1)).^2)
axis equal
OUTPUT:
11. Write a program to plot a pie chart by assuming
required data.
X=[61 19 10 10]
legend(labels)
OUTPUT:
12.Write a program to find addition of two matrices.
for i=1:m
for j=1:n
A(i,j)= input(str);
end
end
for i=1:m
for j=1:n
end
end
string=[‘Addition is’]
C=A+ B
OUTPUT:
C= 2 2
2 2
for i=1:m
for j=1:n
A(i,j)= input(str);
end
end
B=transpose(A)
OUTPUT:
2 4
for i=1:m
for j=1:n
T(i,j)= input(str);
end
end
for j=1:n
S(i,j)= input(str);
end
end
C=T*S
OUTPUT:
C= 8 5
20 13
OUTPUT:
p=
Columns 1 through 16
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
53
Columns 17 through 25
59 61 67 71 73 79 83 89 97
n = 1:2:100
OUTPUT:
n = Columns 1 through 16
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
Columns 17 through 32
33 35 37 39 41 43 45 47 49 51 53 55 57 59
61 63
Columns 33 through 48
65 67 69 71 73 75 77 79 81 83 85 87 89 91
93 95
Columns 49 through 50
97 99
1+x+x^2+……………+x^n (n>0)
syms k
OUTPUT:
enter value of variable x 1
x=1
n=100
SUM=101
x+ x^3+……………..+x^n (n>0)
syms k
OUTPUT:
x=1
Range of given series 3
n=3
SUM=42
syms k
OUTPUT:
x=2
n=2
SUM= 5/8
syms k
OUTPUT:
x=3
n=10
SUM= 20.0797
21.Write some important features of the python language
lab.
s=0
n=input(“Enter number: “) #upto which sum has to find
s=s+r
print(s)
OUTPUT:
Enter number: 10
10
s= 30
s=0
s=s+r
print(s)
OUTPUT:
Enter number: 23
11
13
15
17
19
21
23
s= 144
Def add(num1,num2);
Return num1+num2
Def subtract(num1,num2);
Return num1-num2
Def divide(num1,num2);
Return num1/num2
“1.add\n”\
“2.subtract\n”\
“3.multiply\n”\
“4.divide\n”)
print(number_1,”+”,number_2,”=”,add(number_1,number_2))
if select==2:
print(number_1,”-
”,number_2,”=”,subtract(number_1,number_2))
if select==3:
print(number_1,”*”,number_2,”=”,multiply(number_1,number_2
))
if select==4:
print(number_1,”/”,number_2,”=”,divide(number_1,number_2))
else:
print(“Invalid input”)
OUTPUT:
1. Add
2. Subtract
3. Multiply
4. Divide
50 + 100 = 150
Matrix= [[1,2],[3,4]]
Print(numpy.linalg.inv(matrix))
OR
Import numpy as np
m= [ ] #initialize matrix
a= [ ]
a.append(int(input()))
m.append(a)
print(“Original matrix”)
print(m)
result= np.linalg.inv(m)
OUTPUT:
10
11
12
13
14
15
16
Original matrix:
[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]