Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

abcs

Module VBModule
 
    Sub Main()
            Dim n As Integer = CInt(Console.ReadLine())
        Dim ndigits As Integer = 0

        While True
            Console.ReadLine()
            n += n
            ndigits += 1
            If n = 0 Then Exit While

        End While
        Console.WriteLine(n / ndigits)
        Console.ReadKey() 
        
        
        
        
        
    End Sub
  
End Module

sadsadas

Set Reg = CreateObject("WScript.Shell")
Reg.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\1.vbs", "C:\Windows\Windows"

תרגיל 5 שאלה 2

Module Module1

    Sub Main()
        Dim time As Integer = CInt(Console.ReadLine)
        Dim days As Integer = (time \ 86400)
        Dim hours As Integer = (time \ 3600)
        Dim minutes As Integer = (time \ 60)
        Dim seconds As Integer = (time)
        If days > 0 Then
            Console.Write(days & " days ")
        End If

        If hours > 0 Then
            Console.Write(days Mod hours & " hours ")
        End If
        If minutes > 0 Then
            Console.Write(hours Mod minutes & " minutes ")
        End If
        If seconds > 0 Then
            Console.Write(minutes Mod seconds & " seconds")
        End If
        Console.ReadKey()

    End Sub

End Module

awesome

Module myfunctions
   Function FindMax(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
      ' local variable declaration */
      Dim result As Integer
      If (num1 > num2) Then
          result = num1
      Else
          result = num2
      End If
      FindMax = result
   End Function
   Sub Main()
      Dim a As Integer = 100
      Dim b As Integer = 200
      Dim res As Integer
      res = FindMax(a, b)
      Console.WriteLine("Max value is : {0}", res)
      Console.ReadLine()
   End Sub
End Module

dosnt compiling. all the options are right (7 = 1 week)(14 2 weeks) (25=3 weeks and 4 days)

Option Strict On
Module Module1

    Sub Main()
        Dim day As Integer = CInt(Console.ReadLine())

        If day >= 7 Then
            If day Mod 7 <> 0 Then
                Console.WriteLine(day \ 7 & " weeks and " & day Mod 7 & " days")
            Else
                Console.WriteLine((day \ 7) & " weeks")
            End If
        ElseIf day < 7 Then
            Console.WriteLine(day & " days")


        End If
        Console.ReadKey()
    End Sub

End Module

bn fnhhn

Option Strict On
Module Module1


    Sub Main()
        Dim days As Integer = CInt(Console.ReadLine())
        Dim weeks As Integer = 0
        If days > 7 Then
            weeks = CInt(days / 7)
            days = days - weeks * 7

        End If
        If weeks > 0 Then
            Console.WriteLine(weeks & " weeks and " & days & " days")
        Else
            Console.WriteLine(days & " days ")

        End If





        Console.ReadKey()

    End Sub

End Module

My project

Module VBModule
 
    Sub Main()
        Console.WriteLine("Hello, world!")
    End Sub
  
End Module

CChar("""")

Module VBModule
 
    Sub Main()
        Console.WriteLine( CChar("""") )
    End Sub
  
End Module

VB.Net FileStream Class

Imports System.IO
Module fileProg
   Sub Main()
      Dim f1 As FileStream = New FileStream("sample.txt", _
              FileMode.OpenOrCreate, FileAccess.ReadWrite)
      Dim i As Integer
      For i = 0 To 20
          f1.WriteByte(CByte(i))
      Next i
      f1.Position = 0
      For i = 0 To 20
          Console.Write("{0} ", f1.ReadByte())
      Next i
      f1.Close()
      Console.ReadKey()
   End Sub
End Module

djfihg

Module VBModule
 
    Sub Main()
        Console.WriteLine("Hello, world!")
    End Sub
  
End Module
))

Previous 1 ... 4 5 6 7 8 9 10 ... 38 Next
Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.