write a vb script to add two 2*2 matrix

Answers were Sorted based on User's Feedback



write a vb script to add two 2*2 matrix..

Answer / mudaseer

dim varr1(1,1),varr2(1,1),varr3(1,1)
for i=0 to 1
for j=0 to 1
varr1(i,j)=cint(inputbox("enter the number"))
next
next
for i=0 to 1 step 1
for j=0 to 1 step 1
varr2(i,j)=cint(inputbox("enter the number"))
next
next
for i=0 to 1 step 1
for j=0 to 1 step 1
varr3(i,j)=varr1(i,j)+varr2(i,j)
next
next
for i=0 to 1 step 1
for j=0 to 1 step 1
vstr1=vstr1 & varr1(i,j) & " "
vstr2=vstr2 & varr2(i,j) & " "
vstr3=vstr3 & varr3(i,j) & " "
next
vstr1=vstr1 & vbnewline
vstr2=vstr2 & vbnewline
vstr3=vstr3 & vbnewline
next
msgbox vstr1
msgbox vstr2
msgbox vstr3

Is This Answer Correct ?    23 Yes 7 No

write a vb script to add two 2*2 matrix..

Answer / pawan

Dim oArray1(1,1)
Dim oArray2(1,1)
Dim tArray(1,1)
oArray1(0,0)=8
oArray1(0,1)=9
oArray1(1,0)=5
oArray1(1,1)=-1
oArray2(0,0)=-2
oArray2(0,1)=3
oArray2(1,0)=4
oArray2(1,1)=0
tArray(0,0)=oArray1(0,0)* oArray2(0,0)+ oArray1(0,1)* oArray2(1,0)
tArray(0,1)=oArray1(0,0)* oArray2(0,1)+ oArray1(0,1)* oArray2(1,1)
tArray(1,0)=oArray1(1,0)* oArray2(0,0)+ oArray1(1,1)* oArray2(1,0)
tArray(1,1)=oArray1(1,0)* oArray2(0,1)+ oArray1(1,1)* oArray2(1,1)

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More VB Script Interview Questions

How to select a value from a list box by using Selenium web-driver?

2 Answers   HCL,


Mention how to access array data?

0 Answers  


Hi, Anybody could tell me What is the script for Reverse of Given number. Ex:236--632. Thanks in Advance..

10 Answers   Amazon, CSC,


Explain the scope of the variables using dim, public, and private keywords respectively.

0 Answers  


How to find a latest file from any folder

3 Answers   Ness Technologies,






Have any one know about Test Complete 6, please let me know. If any one have good material regarding Test Complete 6, Please send to my mail id: cns.praveen@gmail.com

1 Answers  


Is VB Script Case sensitive or Case insensitive?

0 Answers  


Write a Script for ATM in QTP

0 Answers  


best training centre in bangalore

2 Answers  


How to open a file. What is the perpose of true and false mode there?

0 Answers  


did any one attended interview in applabs if you had gone through plz tell me the procedure

0 Answers  


how to retrieve native property value in runtime?

1 Answers   Hexaware,


Categories