What's new

Visual Basic Help visual basic (vbnet) willing to give tip

Yaboku

Forum Veteran
Joined
Oct 12, 2016
Posts
1,936
Reaction
626
Points
677
Paturo naman po neto may code nako kaso parang may kulang nag eerror. Pahelp naman po jan gamit vbnet maraming ty.

WILLING TO GIVE TIP JUST PM ME.

GNlSDMpUw3KeV1JFnjClId43f9rssAFYX0fYrT93DGMytybjM0wCvZwH7aPQ-ECTDQJcNtXr5Ptw4jqxh3aTFarliJlRADoXEl3NnEk64i5UNNCaYE9G_m4v3c-Qz0x7BA4v92uC


Eto po yung code ko kaso nag eerror

Module Program
Sub Main(args As String())


Console.WriteLine("This program will ask for an integer input and convert it into its binary and octal equivalent")


Dim input As Integer, bitwisebin As String = ""
Dim bitwiseoct As String = ""

Console.Write("Enter a number: ")
input = Console.ReadLine
Console.WriteLine()

Do While (input > 0)
Dim remainder As Integer = input Mod 2
bitwisebin = remainder.ToString & bitwisebin
input = input \ 2
Loop

Console.WriteLine("The binary equivalent of decimal number is {0} ", bitwisebin)
 
C#:
Public Module Program
  Public Sub Main(args() As String)
      Console.WriteLine("This program will ask for an integer input and convert it into its binary and octal equivalent")
      
      Dim input As Integer, bitwisebin As String = ""
      Dim bitwiseoct As String = ""
      
      Console.Write("Enter a number: ")
      input = Console.ReadLine
      Console.WriteLine()
      
      Do While (input > 0)
        Dim remainder As Integer = input Mod 2
        bitwisebin = remainder.ToString & bitwisebin
        input = input \ 2
      Loop
    
      Console.WriteLine("The binary equivalent of decimal number is {0} ", bitwisebin)
  End Sub
End Module

May mga error ka lang sa pag declare ng Module and Sub saka sa args()
 
C#:
Public Module Program
  Public Sub Main(args() As String)
      Console.WriteLine("This program will ask for an integer input and convert it into its binary and octal equivalent")
     
      Dim input As Integer, bitwisebin As String = ""
      Dim bitwiseoct As String = ""
     
      Console.Write("Enter a number: ")
      input = Console.ReadLine
      Console.WriteLine()
     
      Do While (input > 0)
        Dim remainder As Integer = input Mod 2
        bitwisebin = remainder.ToString & bitwisebin
        input = input \ 2
      Loop
   
      Console.WriteLine("The binary equivalent of decimal number is {0} ", bitwisebin)
  End Sub
End Module

May mga error ka lang sa pag declare ng Module and Sub saka sa args()
Yung octal po ba pano makuha pwede po ba padagdag?
 
Di po ako marunong masyado sa c#. Pakiayos na lang po kung may error.

Dim ctr As Integer = 1
Do While (input > 0)
Dim remainder As Integer = input Mod 2
If (ctr=1) {
Dim octal As Integer = remainder * 1}
else if (ctr=2){
Dim octal As Integer = remainder * 4}
else if (ctr=3){
Dim octal As Integer = remainder * 2}
else if (ctr=4){
Dim octal As Integer = remainder * 1}
bitwisebin = remainder.ToString & bitwisebin
bitwiseoct = bitwiseoct + octal
input = input \ 2
ctr = ctr + 1
Loop
 
Last edited:
Back
Top