write a vb script to add two 2*2 matrix

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1600


How can the spaces from the string be removed?

591


What is the purpose of on error resume next statement?

576


Mention what is variant in vbscript?

554


Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.

1846






How to Enter Values on the Command promt using VB script

1531


Hi Friends my Question is very simple,in Manual testing when we click on a hyper link it directs us to the relavent page or it re-directs us to the current page,so there we can easily write testcase but same thing if we do in automation script using QTP & need to generate report using Reporter.report event how we will do it?thanks in advance...

1651


I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?

862


How to declare an array in vbscript?

668


In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?

2020


Difference between dim,public and private variables in vb script?

525


How to write functions and sub in vb script?

622


How to assign a numeric value to a variable?

618


i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me

1797


Mention when to use function procedures and what are its characteristics?

627