Outputs
Outputs
1.program
enter the size of the matrix a 2 2
enter the elements of the matrix a1 2 3 4
"enter the size of the matrix b 2 2
enter the elements of the matrix b1 2 3 4
"the resultant matrix c 7 10
15 22
2. program
enter the number of items 5
enter the items to sort 4 2 8 5 1
the sorted items are 1 2 4 5 8
3.stack
1.push
2.pop
3.display
4.exit
Enter ur choice 1
Enter the element to be pushed on stack10
1.push
2.pop
3.display
4.exit
Enter ur choice 1
Enter the element to be pushed on stack20
1.push
2.pop
3.display
4.exit
Enter ur choice 1
Enter the element to be pushed on stack30
1.push
2.pop
3.display
4.exit
Enter ur choice 1
Enter the element to be pushed on stack40
1.push
2.pop
3.display
4.exit
Enter ur choice 2
40 the poped element
1.push
2.pop
3.display
4.exit
Enter ur choice
10
20
30
1.push 2.pop 3.display
4.exit
Enter ur choice 4
3. program(q)
1.add 2.del 3.display
Enter ur choice 1
Enter the element 8
Enter ur choice 1
Enter the element 5
Enter ur choice 1
Enter the element 3
Enter ur choice 3
8 5 3
Enter ur choice 2
The element deleted from the queue is :8
4.program
enter the value of n
5
enter n values 5 1 2 7 9
enter the item to be searched 7
element found
4.program(binary)
enter the value of n
5
enter n values 2 4 5 8 9
enter the item to be searched 8
element found
5
th
program
Enter the vertices 3
Enter the adjacent matrix(999 for no edge):
(1 1) 9
( 1 2) 999
(1 3) 11
(2 1) 8
(2 2) 999
(2 3) 10
(3 1) 999
(3 2) 999
(3 3) 2
Enter the source vertex 1
The shortest path between vertex 1 to vertex 1 is 0
The shortest path between vertex 1 to vertex 2 is 999
The shortest path between vertex 1 to vertex 3 is 11
6. program
enter the n numbers
212
Palindrome
7.program
enter the 9 elements
5 8 6 4 1 2 8 9 7
the matrix is
5 8 6
4 1 2
8 9 7
inverse of a matrix is
-0.65 -0.71 1.64
-0.12 -0.76 1.11
0.59 0.82 -1.59
8
th
program
enter the values of X and N 2
2
X to the power N 4
9
th
program
enter the number to find factorial of it 3
3!=6