🔒 Closed Help visual basic (vbnet) willing to give tip

Status
Not open for further replies.

Yaboku

Established
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
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 555
    Views
  • 4
    Participants
Last reply from:
dee-u

Online now

Members online
1,006
Guests online
1,124
Total visitors
2,130

Forum statistics

Threads
2,276,159
Posts
28,967,949
Members
1,231,144
Latest member
jonreipogi
Back
Top