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

Explain the constants in vbscript?

0 Answers  


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

0 Answers   Altair,


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

2 Answers  


Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

0 Answers  


Which is the default Data types in VBScript?

7 Answers   AppLabs,






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

0 Answers  


Why to add checkpoint in QTP What's the purpose of checkpoints & how to add it

2 Answers  


Which in-built function related to an array joins substrings into one string in the vbscript language?

0 Answers  


How to remove the spaces in a string Ex: "this is apple"

5 Answers   Cap Gemini,


can any body give the code to write the function for given suppose user login with usrer id and pwd to yahoomail.after cliking "sign in"if it is valid user id the next page will display userid'message box.( Note u have to use excel sheet to retrive the userid's data)

3 Answers   Bally Technologies,


How to write Descriptive programming in .VBS file i wrote this code but it is giving error.. Dim qtApp set qtApp=createobject("QuickTest.Application") qtApp.Launch qtApp.Visible=True Set objIE = CreateObject("InternetExplorer.Application") objIE.visible = True objIE.Navigate "www.gmail.com" browser("title:=gmail").title("title:=gmail")

2 Answers  


what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?

0 Answers   Estuate,


Categories