I want to know how to write a program to obtain sum of the first and last digit of a number?
Jump to Post
Function sumFirstLast(number As Integer) As Integer Dim numberString As String numberString = Abs(number) & "" sumFirstLast = Val(Mid(numberString, 1, 1)) + Val(Mid(numberString, Len(numberString), 1)) End Function
All 7 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.