write a vbscript for finding the sum of the numbers from 1-
50
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / kishore
dim n
n=inputbox("enter a number")
k=(n*(n+1))/2
msgbox k
Is This Answer Correct ? | 10 Yes | 13 No |
What is wrong with the following code: <%afname="header.asp"%><!?#include file ="<%=afname%>"?>
Anyone have qtp11.0 crack?
Give examples where vb script can directly run on users system with windows as os?
What is the use of the formatdatetime function in the vbscript language?
1. How to handle object implementation change in DP for Ex: i have login page with username,pasword (editboxes),login,cancel(buttons). Here i written DP code for login page with the help properties. My questions: 1.If properites are changing dynamically i will do (i want code for that) 2.if objects are changed dynamcally i will do (i wnat code for that)
Mention how you can call vbscript functions?
wat is com(common object model)object for mozilla firefox??? if any knows the exact answer....plz rply me
when you use For Loop, While..do, do..while? at what situations which loop will use.
input values to accept 2 numbers & print the product, difference and sum using switch case
how to automatically update the sql server2005 database records when insert in vb6?
How will you convert a given number to long in vbscript?
How to open excel in vb script?