Sunday, May 3, 2015

Basic Programs that can be ask by Interviewer during QTP Interview

1. Write the program to print following string.
*
**
***
****
*****

Ans.
'Written by Zeeshan Khan

For i= 1to 5
    For j=1 to i

        vstr =vstr& "*" & " "

    Next
vstr =vstr &vbnewline
Next
print vstr

Output would be:





Q2. Write the program to print following string.

*****
****
***
**
*
Ans.

'Written by Zeeshan Khan
For i= 5 to 1 step-1
    For j=i to 1 step-1

        vstr =vstr& "*" & " "

    Next
vstr =vstr &vbnewline
Next

print vstr

OutPut Would be:


No comments:

Post a Comment