the code is as follows
static void main(string[] args)
{
Int num = 10;
Int num = 20;
If (10 > 20);
{
return;
}
Console.WriteLine("10 > 20");
}
basically what I am trying to do is get the code to run to get the output of the program in the command window of visual studio
bunch of things:
int num
is defined twice
int
to num2
Int
and If
should be int
and if
;
after the if(10 > 20)
line
10 > 20
with num > num2
to make the first two assignments actually usefulyou are defined variable num two times
static void main(string[] args)
{
Int num1 = 10;
Int num2 = 20;
If (10 > 20)
{return;}
Console.WriteLine("10 > 20");
You define the variable num
twice. Maybe you can define two variables num1
and num2
to store them.
int num1 = 10;
int num2 = 20;
Do you want to compare two int numbers? If so, you can refer to the following statement.
if(num1 > num2)
{
//...
}
Besides, you want to print "10 > 20"
, rather than "10 < 20"
?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.