Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,938 questions

51,875 answers

573 users

How to use division (divide numbers) with and without remainder in VB.NET

2 Answers

0 votes
Module Module1

    Sub Main()

        Dim n As Integer = 371

        While n <> 0

            n = n / 10 ' the remainder is not ignored (/)
            Console.WriteLine(n)

        End While

        Console.WriteLine()

        n = 371
        While n <> 0

            n = n \ 10 ' the remainder is ignored (\)
            Console.WriteLine(n)

        End While

    End Sub

End Module

' run:
' 
' 37
' 4
' 0

' 37
' 3
' 0

 



answered May 6, 2017 by avibootz
0 votes
Module Module1

    Sub Main()

        Dim n As Integer = 10

        Console.WriteLine(n / 3) ' the remainder is not ignored (/) (Division)
        Console.WriteLine(n \ 3) ' the remainder is ignored (\) (Integer Division)

    End Sub

End Module

' run:
' 
' 3.33333333333333
' 3

 



answered May 6, 2017 by avibootz
edited May 6, 2017 by avibootz

Related questions

1 answer 165 views
1 answer 172 views
172 views asked Jan 7, 2022 by avibootz
2 answers 209 views
1 answer 98 views
98 views asked Jan 7, 2022 by avibootz
1 answer 145 views
...