write a vb script to add two 2*2 matrix
Answers were Sorted based on User's Feedback
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 |
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 |
Check whether given Number is Even or Odd?
what is the differenece btwn scripting language and programming language
Please Example programms on vbscript 1)writing functions and calling functions
Explain few date functions in vbscript?
Mention the rules for using option explicit statement?
how to write basic programs in VB Script like addition, multiplication?
How will you compare two strings in vbscript?
Explain about constants in vb script?
a;;b;c;;;d in this string output is abcd will come how can we do that in vbscript in QTP testing?
How to assign a numeric value to a variable?
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
What is the output of a + b in vbscript if a = 5 and b = 10?