VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Modulus of a given number

by Barkın ¨n¨ulu (1 Submission)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 30th September 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Modulus of a given number

Rate Modulus of a given number



Private Sub Command1_Click()

a = InputBox("enter the mod of the number")

End Sub

Private Sub Command2_Click()
Dim sayı As Double
Dim bölüm As Double
Dim sonuc As Double
Dim modül As Double
Dim toplam As Double
Dim barkın As Label
Dim sonuc1 As Double
Dim sonuc2 As Double
Dim sonuc3 As Double
modül = Val(a)
sayı = Text1.Text
bölüm = sayı / modül



toplam = 0
'If a < 1 And a > 0 Then
 ' Text2.Text = 0
'Exit Sub
'End If
'If a < 0 Then
 ' a = (-1) * a
 'Do While toplam < a
  'If a - toplam > 1 And a - toplam < 2 Then
   '  Exit Do
  'End If
 'toplam = toplam + 1
'Loop
'Text2.Text = (-1) * (toplam + 1)
'Exit Sub
'End If


Do While toplam < bölüm
  If bölüm - toplam > 1 And bölüm - toplam < 2 Then
     Exit Do
  End If
 toplam = toplam + 1
Loop
'Text2.Text = toplam + 1
sonuc = toplam + 1
'If bölüm - sonuc = 0 Then
   'Text2.Text = modül
   'Exit Sub
'Else
  sonuc1 = bölüm - sonuc
sonuc2 = sonuc1 * modül
'If sonuc2 = (-1) * say&#305; Then
 '  Text2.Text = 0
'End If
If sonuc2 = (-1) * modül Then
  Text2.Text = 0
  Exit Sub
 End If
Text2.Text = sonuc2

'End If

End Sub



Download this snippet    Add to My Saved Code

Modulus of a given number Comments

No comments have been posted about Modulus of a given number. Why not be the first to post a comment about Modulus of a given number.

Post your comment

Subject:
Message:
0/1000 characters