1 4
1 4
PROBLEM 01. Write a program that, input the center ,radius and any point on the circle .show that the
point is inside of the circle ,outside of the circle or the point on the circle.
PROBLEM 02 : Write a program that ,given three vertex of triangle and given any point on the triangle.
Find out the volume of triangle.
PROBLEM 03: write a program that, find the maximum and minimum among three number.
PROBLEM 04: Write a program that, find the maximum & minimum number among the nth number.
PROBLEM 05: Write a program that find the maximum & minimum number .Also find average of
maximum & minimum number & distance of maximum & minimum number
PROBLEM 06: Write a program that ,find the Fibonacci series up to nth terms.
PROBLEM 07 : Write a program that ,find the factorial and summation among the nth number.
PROBLEM 08: write a program that ,inter nth random number ,find that acceding order of the number
and descending order of the number.
PROBLEM 09: write a program that, input any n the random number .Find that this number which
position of this random number.
PROBLEM 10 :Create a row vector that has the elements are 32,4,81,e^2.5,63,cos(pi/3),and 14.12.
PROBLEM 11 : Create a column vector that has the elements are 55,14,In(51),987,0,and 5sin((2.5(pi)).
PROBLEM 12 :Create a row vector in which the first element is 1,the last is 33,with an increment of 2
between the elements (1,3,5,…..,33).
PROBLEM 13: Create a column vector in which the first element is 15,the elements decrease with
increments of -5,and the last element is-25.(A column vector can be created by the transpose of a row
vector ).
PROBLEM 14 : Create a row vector with 15 equally spaced elements in which the first element is 7 and
the last element is 40.
PROBLEM 15 : Create a column vector with 12 equally spaced elements in which the first element is-1
and the last element is-15.
PROBLEM 16: %Create the following matrix A= [6 43 2 11 87;12 6 34 0 5;34 18 7 41 9] use the matrix A
to : a)Create a five -element row vector named va that contains the elements of the second row of A .
b)Create a three-element row vector named vb that contains the elements of the fourth column of A.
c)Create a ten –element row vector .nmed vc that contains the elements of the first second row of A
d)create a six element row vector named vd that contains the elements of the second and fifth
columns of A.
a) Create a three-element column vector named ua that contains the elements of the third column of
C b) Create a five- element column vector named ub that contains the elements of the second row of
C
c) Create a nine-element column vector named uc that contains the elements of the first, third and
fifth columns of C .
d) Create a ten-element column vector named ud that contains the elements of the first and second
rows of C.
PROBLEM 19: program-2D contour plot problem: Creat a plot from the function Z=(1.8).^((-
1.5)*sqrt(X^2+Y^2)).*(sin(X).*cos(.5*Y));over the domain - 3<=x<=3 -3<=y<=3.
PROBLEM 20: program-32D contour plot problem:creat a plot from the function Z=(1.8).^((-
1.5)*sqrt(X^2+Y^2)).*(sin(X).*cos(.5*Y));over the domain-3<=x<=3 -3<=y<=3.
PROBLEM 21:program-3D mesh contour plot problem:creat a plot from the function Z=(1.8).^((-
1.5)*sqrt(X^2+Y^2)).*(sin(X).*cos(.5*Y)); over the domain -3<=x<=3 -3<=y<=3.
PROBLEM 22:program-3D plot surface Problem : Create a plot from the function Z=(1.8).^((-
1.5)*sqrt(X^2+Y^2)).*(sin(X).*cos(.5*Y)); over the domain - 3<=x<=3 -3<=y<=3.
PROBLEM 24: program- sphere plot problem:creat a plot from the function Z=(1.8).^((-
1.5)*sqrt(X^2+Y^2)).*(sin(X).*cos(.5*Y)); over the domain -3<=x<=3 -3<=y<=3.
PROBLEM 25: program-2D contour plot problem: Create a plot from the function Z=(X^2+Y^2).^2-
(X^2+Y^2); over the domain x=[-1.1:.001:1.1]; y=[-1.1:.001:1.1];
1-2
PROBLEM 01: Write a program that takes the center, radius the circle and takes any point. Show that
the point is inside of the circle or outside of the circle or the point on the circle
PROBLEM 02: Write a program that takes three vertices of a triangle and also takes any point, and
display whether the point is outside or inside.
PROBLEM 03: Create a program that takes three numbers, find the maximum and minimum number
and also find the average of maximum & minimum numbers and difference between maximum &
minimum number.
PROBLEM 04: Create a program that takes n numbers and find the maximum and minimum number.
PROBLEM 05: Write a program that takes any number and find factorial of this number.
PROBLEM 06: Write a program that takes any number n and find the Fibonacci series up to nth terms.
PROBLEM 07: Write a program that, takes n random numbers and find the acceding order of the
numbers.
PROBLEM 08: Write a program that takes n random numbers and find the descending order of the
number.
PROBLEM 09: Write a program that takes n random numbers and find a specific number’s position of
this taken numbers.
PROBLEM 10: Create a row vector that has the elements : 32,4,81,e^2.5,63,cos(pi/3),and 14.12.
PROBLEM 011: Create a column vector that has the elements :55,14,In(51),987,0,and 5sin((2.5(pi))
PROBLEM 012: Create a row vector in which the first element is 1,the last is 33,with an increment of 2
between the elements (1,3,5,…..,33).
PROBLEM 013: . Create a column vector in which the first element is 15,the elements decrease with
increments of -5,and the last element is-25.(A column vector can be created by the transpose of a row
vector ).
PROBLEM 014. Create a row vector with 15 equally spaced elements in which the first element is 7
and the last element is 40.
PROBLEM 015: Create a column vector with 12 equally spaced elements in which the first element is-1
and the last element is-15.
PROBLEM 016: Create a vector name it Afirst,that has 16 elements in which the first is 4,the
increament is 3 and the last element is 49.then,using the colon symbol,create a new vector,call it
Asecond,that has eight elements.the first four elements are the first four elements of the vector Afirst
,and the last four are the last four elements of the vector Afirst.
PROBLEM 017: Create the matrix shown below by using the vector notation for creating vectors with
constant spacing and/or the linspace command when entering the rows.
PROBLEM 018: C R E A T E T H E F O L L O W I N G M A T R I X A :
U S E TH E M A T R I X A T O :
a) Create a five -element row vector named va that contains the elements of the second row of A . b)
Create a three-element row vector named vb that contains the elements of the fourth column of A. c)
Create a ten –element row vector named vc that contains the elements of the first second row of A d)
Create a six element row vector named vd that contains the elements of the second and fifth columns
of A.
PROBLEM 019: C R E A T E T H E F O L L O W I N G M A T R I X C :
a) Create a three-element column vector named ua that contains the elements of the third column of
C
b) Create a five- element column vector named ub that contains the elements of the second row of C
c) Create a nine-element column vector named uc that contains the elements of the first,third and
fifth columns of C .
d)Create a ten-element column vector named ud that contains the elements of the first and second
rows of C.
PROBLEM 020: C R E A T E T H E F O L L O W I N G M A T R I X A :
A=
1 2 3 4 5 6 7
2 4 6 8 10 12 14
21 18 15 12 9 6 3
5 10 15 20 25 30 35
a) Create a 3x4 matrix B from the 1st,3rd,and 4th rows, and the 1st ,3rd through 5th, and 7 th columns
of the matrix A.
b) Create a 15 elements-long row vector u from the elements of the third row,and the 5 th and 7th
columns of the matrix A.
PROBLEM 021: Using the zeros,ones,and eye commands create the following arrays:
a= 0 0 0 0 0
00000
b= 1 0 0 0
0100
0010
0001
c=11
11
11
Problem 22: using the eye command create the array A shown on the left below. Then, using the colon
to address the elements in the array , change the array to be like the one shown on the right.
A=1000000
0100000
0010000
0001000
0000100
0000010
0000001
A=
2220555
2220555
3330555
0001000
4470999
4470999
4470999
PROBLEM 0123: 23. Using the zeros and ones commands create a 3x5 matrix in which the
first,second,and fifth columns are 0’s,and the third and fourth columns are 1’s.
PROBLEM 24.Create a 5 x 7 matrix in which the first row are the numbers 1 2 3 4 5 6 7 ,andsecond row
are the numbers 8 9 10 11 12 13 14 , the third row are the numbers 15 through 21,and so on.from the
this matrix create a new 3 x 4 matrix that is made from rows 2 through 4,and columns 3 through 6 of
the first matrix.
PROBLEM 25. Create a 3 x 3 matrix A in which all the elements are 1, and create a 2 x 2 matrix B in
which all the elements are 5.then , add elements to the matrix A by appending the matrix B such that
A will be .
A=
11100
11100
11100
00055
00055
√
Problem 26: Create a plot from the function over the domain -
3<=x<=3 & -3<=y<=3.
Problem 27: program-32D contour plot Problem: Create a plot from the function
√
over the domain -3<=x<=3 & -3<=y<=3.
PROBLEM 31: 31.program- sphere plot Problem: Create a plot from the function
√
over the domain -3<=x<=3 & -3<=y<=3.
2
PROBLEM 01: Print the A.M, G.M, H.M, S.D, and M.D using the numbers.
PROBLEM 03: Write a program to finf the multiple between two matrixs.
PROBLEM 05: Read the matrix A and print AA’ and A’A.
PROBLEM 06: Read the matrix A of order n and print the sum of 1. Diagonal elements 2. The last
column elements 3. The lower triangular elements.
PROBLEM07: Read a squre matrix A of order n and print a symmetric matrix B and skew-symmetric
matrix C such that A=B+C.
PROBLEM08: Print the area and circumfrernce of a circle when the radius of a circle is given.
PROBLEM 09: Print the area and circumference of a circle when the end points of a diameter are
given.
PROBLEM 10: Print the area and perimeter of a triangle if the sides of a triangle are given.
PROBLEM 11: Print the area and perimeter of a triangle if the vertices of the triangle are given.
PROBLEM12: Solve the quadratic equation and print its roots. (roots may be rea or complex).
… … … …… ..
… …. … …
…………
………
…………
PROBLEM 18: Find the second maximum of the given numbers.
PROBLEM 21: Find the ascending and descending order of the list of numbers. Also find the second
maximum number.
3-1
3-2
Using addition, subtraction, multiplication, division, square root, exponential, logarithm, and
trigonometry function. Calculate the followings:
(a)
(b) √
(√ )
(c) ( )
(d)
Define the variables x and z as x=9.6, and z=8.1, then evaluate (up-to ten decimal):
(a) ( )
(b)
Define the variables a, b, c, and d as: a= 15.62, b=-7.08, c=62.5 and d= . ( − ) then evaluate
(up-to decimal form):
(a)
√| |
(b)
Find the value of the following expression:
(a) ( )
√
Define two variables: 𝜶 = , = . Using these variables, shows that the following trigonometric
identity is correct by calculating the value of left and right sides of the equation.
Suppose we want to calculate final balances for investments of Taka 75000, Taka 100000, Taka
300000, Taka 500000 and Taka 1199900, over 10 years, with an interest rate of 9 percent.
4
1. Write a program that takes a number from keyboard and tells whether it is positive or
negative.
2. Write a program that takes an integer number from keyboard and tells whether it is even or
odd.
3. Write a program that finds maximum and minimum among three numbers.
8. Write a program that read three numbers and determine the root of the equation
.
9. Write a program that accepts as input a year in the format YYYY and determine whether the
given year is a leap year or not.
13. Write a program that sum odd number and multiply the even number 0 to 10.
14. Write a program that reads a three digit number that add and multiply the digits.