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

Hi, Anybody could you Please tell me How to write the script for Checking whether given number is Prime Number or not..Thanks in Advance

6 Answers   Amazon,


When to use function procedures and what are its characteristics?

0 Answers  


What is wrong with the following code: <%afname="header.asp"%><!?#include file ="<%=afname%>"?>

1 Answers  


write a vb script to display factorial of a number using function

1 Answers  


I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.

0 Answers  


Explain about scrrun.dll?

0 Answers  


How should i Create Email invite with server-side Coding?

0 Answers   Altair,


How to capture a runtime error in vbscript?

0 Answers  


What are the special sub-types in vbscript?

0 Answers  


Here in my automation tool, i am retreiving some values and i need to store this values in the excel. How can i achieve this?. We are using VBA as scripting language. please let me know if you require any further inputs.

1 Answers  


Hi I am having one folder with set of text files now i want to read and write that text files data into QTP. Any help plsss.

1 Answers  


What is select case statement?

0 Answers  


Categories