在visual basic中遇到麻烦

时间:2014-03-26 13:32:03

标签: visual-studio-2012 console

模块模块1

Sub Main()
    'program to display whether first number is divisible by second
    Dim a, b As Integer
    Console.WriteLine("enter first number ::")
    Console.ReadLine(a).ToString()
    Console.WriteLine("enter second number ::")
    Console.ReadLine(b).ToString()
    If a Mod b = 0 Then
        Console.WriteLine("numbers are divisible!")
    Else
        Console.WriteLine("numbers are not divisible!")
    End If
    Console.ReadLine()
End Sub

结束模块

我无法通过第一个if语句。当我执行程序时,它不会显示更多信息,只是输入值并冻结。我是视觉基础的新手,但我不知道会发生什么事。

1 个答案:

答案 0 :(得分:0)

if a Mod b=0更改为if a Mod b==0 通过使用single =你基本上是分配值而不是检查

相关问题