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

Which data type/types are supported by vbscript language and what are their specialties?

0 Answers  


what is diff between static and dynaic arrys?

0 Answers  


write a vb script to add two 2*2 matrix

2 Answers  


How to get the length of the string by making use of the string function?

0 Answers  


Mention the rules for using option explicit statement?

0 Answers  






What is the event handling in vbscript?

0 Answers  


Can u describe what kind of testing are for OTC derivates by banks.

0 Answers   BoA,


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

0 Answers  


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

0 Answers  


Hi, Anybody could tell me What is the script for Reverse of Given number. Ex:236--632. Thanks in Advance..

10 Answers   Amazon, CSC,


we executed QTP scripts in one browser(i.e IN)same scripts is working on another browsers or not (i.e mean netscap,m azol..like )

6 Answers   Accenture,


Mention how to assign a date value to a variable?

0 Answers  


Categories