Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3
5 4 5

Answers were Sorted based on User's Feedback



Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / ashok kumar

Here....

For i = 1 To 5
For j = 5 To i Step -1
temp = temp & " " & j
Next
MsgBox temp
temp = ""
Next

Is This Answer Correct ?    12 Yes 3 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / vishnu

'5 4 3 2 1
'5 4 3 2
'5 4 3
'5 4
'5
For i=5 to 1 step -1
temp = temp & i
Next
For i=5 to 1 step -1
print temp
temp = left(temp,i-1)
Next

Is This Answer Correct ?    4 Yes 2 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / sireesha

For i = 1 To 5
For j = 5 To i Step -1
temp = temp & " " & j
Next
MsgBox temp
temp = temp&vbnewline
Next
msgbox temp

Is This Answer Correct ?    2 Yes 0 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / ravindra v

For i=1 to 5
For j=5 to i step -1

temp=temp&j

Next
print temp
temp=null
Next

Is This Answer Correct ?    0 Yes 0 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / machiraju veera venkata naga s

p=""
For i = 1 To 5 Step 1
t=""
For j = 5 To i Step -1
t=t&" "&j
Next
p=p&""&t
Next
print p

(Test this code right now... Its mine.)

Is This Answer Correct ?    0 Yes 0 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / bhargavi

For i = 1 To 5
For j = 5 To i Step -1
  temp = temp & " " & j
Next
If i=5 Then
  print temp
End If
Next 

Is This Answer Correct ?    0 Yes 0 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / pravati

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5
x="5 4 3 2 1 5 4 3 2 5 4 3 5 4 5"
y=split(x," ")
msgbox ubound(y)
For i = 0 to ubound(y) Step 1
msgbox y(i)
Next

Is This Answer Correct ?    0 Yes 0 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / pushkar1206

a=inputbox("enter number")
b=len(a)
For i=b to 1 step -1
c=left(a,i)
d=d&c&vbnewline
Next
msgbox d

Is This Answer Correct ?    0 Yes 0 No

Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 ..

Answer / phu

for i=4 to 0 step-1
{
for j=0 to i step+1
print (5-j)
}

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More QTP Interview Questions

how to convert 100 into hundred repees only and viceversa

0 Answers  


How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?

0 Answers  


Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out

0 Answers  


how to parameterizing values from an excel sheet in Quick test professional?

1 Answers  


What are the Features & Benefits of Quick Test Pro ?

1 Answers   Crea,






Can we record using all the modes in a single script? Explanation with example is appreciated

0 Answers  


what is the difference between Automation object model(AOM) and test object model(TOM)

2 Answers   UHG,


iam working in QTP for 2+ of exp if i attend the interview what r questions asked in perfomence testing{loadrunner} ? pls any one can say answer to this question?

0 Answers   Infosys,


What are the ordinal identifiers in web page?

0 Answers  


what time u r using data driven test in ur app"

6 Answers   Accenture, IBM,


Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime. suppose i wrote datatble.value(1) = "Test data" so when i run the script it says column(1) doesn't exist. Then i write something in column A1 manualy and run the script again. Now it works fine. Pls clarify how i can put value in blank cell of datatable.

10 Answers   Apex,


What are Add-ins availble in licensed version QTP8.2

1 Answers   TCS,


Categories