VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



to tell the sum of the digits of a 3/4 digt number entered by the user

by Sachin Tiwari (3 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 29th January 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)

to tell the sum of the digits of a 3/4 digt number entered by the user

API Declarations


Dim a As Integer

Rate to tell the sum of the digits of a 3/4 digt number entered by the user



a = Text1.Text
b = a Mod 10
c = (a - b) \ 10
k = c Mod 10
i = (c - k) / 10
n = i Mod 10
f = (i - n) / 10

Print b + k + n + f
End Sub


Download this snippet    Add to My Saved Code

to tell the sum of the digits of a 3/4 digt number entered by the user Comments

No comments have been posted about to tell the sum of the digits of a 3/4 digt number entered by the user. Why not be the first to post a comment about to tell the sum of the digits of a 3/4 digt number entered by the user.

Post your comment

Subject:
Message:
0/1000 characters