answersLogoWhite

0

Dim no As Integer, r As Integer, sum As Integer = 0, n As Integer = 0


Console.WriteLine("Enter number" & vbLf)



no = Int32.Parse(Console.ReadLine())


n = no


While n > 0


r = n Mod 10


n = n \ 10


sum += r * r * r


End While



If sum = no Then


Console.WriteLine("{0} is a Amstrong number", no)


Else


Console.WriteLine("{0} is not a Amstrong number", no)


End If


Console.ReadLine()

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How do you get a timer to work in a loop to slow it down in vb6?

You can use the Sleep function in VB6 to introduce a delay within your loop. This function pauses the execution for a specified number of milliseconds. Just insert Sleep(milliseconds) in your loop to slow it down.


How do you call GetLastError in vb6?

In VB6, you can call the GetLastError function by declaring it in your code using the Declare statement. This function is part of the Windows API, and you would typically declare it like this: Declare Function GetLastError Lib "kernel32" () As Long You can then call GetLastError in your code to retrieve the last error code generated by a Windows API function. For example: Dim errorCode As Long errorCode = GetLastError()


How do you get square root in Microsoft visual basic?

The function is Sqr() in VB6 and Math.Sqr() in .NET.


Solving transportation problem in Visual basic programming?

hi every body my name is mohamed i live in egypt i am a programer with vb6 i ca solve the transport problem using vb6 just keep in touch with me at my phone number 002 0106909294 thnks


What is difference between vb5 vb6?

VB6 is a more recent and more advanced version of visual basic.


VB6 access network drive from Virtual Machine?

To access a network drive from a Virtual Machine (VM) using Visual Basic 6 (VB6), ensure that the VM is properly configured to connect to the network. You can map the network drive within the VM by using the "Map Network Drive" feature in Windows Explorer or by using the Net Use command in Command Prompt. In your VB6 application, you can then reference the mapped drive using its drive letter, allowing you to read from or write to files on that network drive seamlessly. Make sure that the necessary permissions are granted for the VM to access the network resources.


How do you convert vb6 to dmg?

A .vb6 file is visual basic 6 source code, sometimes with it are .frm files that you would need. A .dmg is a Macintosh binary. you would have to find a program to compile the vb6 code to a Macintosh binary.


'Download Visual Studio 6 Or Visual Basic 6 In Free?

Studio consists of C#, VisualJ, etc. Visual Basic is the predefined function of the VB6 environment. if you want to code in VB strictly, download VB6, but if you want to use C#, etc. than use VS6. But by now, I recommend upgrading to VS2008


Differences butween the vb6 asnd vbnet?

Please refer the following link, there you can find useful information about differences between VB6 and VB .NET


How can you execute a new line in VB6?

vbNewLine


How can you make a vb6 project a web based project or how will you able to embed vb6 project or vb.net project into asp.net website?

you simply cant, unless you know how to upload exe's to the internet.


Free vb6 source code download for submission?

thanks