QTP

Thursday, 20 September 2012

1+(1+2)*2+(1+2+3)*3+(1+2+3+4)*4 if n=1 then o/p is 1 if n=2 then o/p is 1+(1+2)*2 if n=3 then o/p is 1+(1+2)*2+(1+2+3)*3

n=cint(inputbox("Enter the value"))

For i=1 to n
For j=1 to i

    c=c+j

    If j=i Then
        e=e+(c*j)
    End If

    Next
    c=empty
Next
print e
Posted by QTP at 10:57 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2012 (31)
    • ▼  September (1)
      • 1+(1+2)*2+(1+2+3)*3+(1+2+3+4)*4 if n=1 then o/p is...
    • ►  July (1)
    • ►  May (1)
    • ►  April (28)

About Me

QTP
View my complete profile
Picture Window theme. Powered by Blogger.