write a vbscript for finding the sum of the numbers from 1-
50

Answers were Sorted based on User's Feedback



write a vbscript for finding the sum of the numbers from 1- 50..

Answer / jethva_trupti

<html>
<body>

<script type="text/vbscript">
dim n,i,sum
sum=0
i=1
n=5
do while (i<=n)
sum=sum+i
i=i+1
loop
document.write(sum)
</script>

</body>
</html>

Is This Answer Correct ?    60 Yes 15 No

write a vbscript for finding the sum of the numbers from 1- 50..

Answer / ankita

dim i ,n ,sum as integer
n=50
sum=0
for i=1 to n
sum=sum+i

msgbox("sum of 1 o 50 no. =" +sum)
next

Is This Answer Correct ?    19 Yes 7 No

write a vbscript for finding the sum of the numbers from 1- 50..

Answer / kishore

dim n
n=inputbox("enter a number")
k=(n*(n+1))/2
msgbox k

Is This Answer Correct ?    10 Yes 13 No

Post New Answer

More VB Script Interview Questions

What is the difference between ByRef and ByVal. When to use ByRef and ByVal

5 Answers   Polaris, TCS,


There is a web Table where You will find Two Columns First Column consist of Check box and Second column consist of Test cases ID(Viz T1,T2,T3....Etc); If You select any Test case ID, respective Check boxes to be checked write a VBSCRIPT for this scenario?

1 Answers   eMids,


The function template cocept is implemented in vb.net is ???

0 Answers  


How will you convert a string to upper case string using vbscript?

0 Answers  


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

0 Answers  






what do you mean .ota mobile format

0 Answers  


What are the differences between Visual Basic, VBA and VBScript? When would it be appropriate to use one as opposed to another?

1 Answers   Infosys,


write a vb script to open a text file and write into it

2 Answers  


What is the technology used by vb script?

0 Answers  


how to get date format from system locale..format means neither long nor shor... format from system locale. i need like your date is mm/dd/yyyy formate or mm-dd-yy or with time like that. how to get.

2 Answers  


Mention how to create a cookie using vbscript?

0 Answers  


What is the differene between QTP 8.2 and QTP 9.0 and QTP 9.1,Pls give me answer ASAP.

3 Answers   Accenture,


Categories