View Single Post
  #1  
Old 15-12-2009, 11:25 PM
.BZU.'s Avatar
.BZU. .BZU. is offline


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Cool Power Series (SIMPLE,EXTENDED) Visual Basic Console Application Code By Wasif

Power Series (SIMPLE)
Code:
Module Module1
   
   Sub Main()
   
   
   
   For n = 1 To 5
   
   If n = 5 Then
  Console.Write("{0}^{1} ", n, n + 1)
   Else
                  Console.Write("{0}^{1} + ", n, n + 1)
  End If
   
   
   Next
   
   
   End Sub
   
  End Module
Power Series (EXTENDED)
Output: 1^2 + 2^3+ 3^4 + … = 1+8+ 81 ….
Code:
 Module Module1
   
   Sub Main()
   Dim buffer As String
   Dim temp As Double
   
          temp = 0
          buffer = ""
   For n = 1 To 5
   
   If n = 5 Then
  temp = n ^ (n + 1)
                  Console.Write("{0}^{1} ", n, n + 1)
  buffer = buffer & temp
   Else
                  temp = n ^ (n + 1)
                  Console.Write("{0}^{1} + ", n, n + 1)
                  buffer = buffer & temp & "+"
   End If
   
   
   Next
   
          Console.WriteLine(" = " & buffer)
   End Sub
   
  End Module

__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote