0
I m not sure what's wrong with my code?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { int b=25; int a=93; do{ a=(a<b)? a:b; Console.WriteLine(a); a+=b;}while (a>b); } } }
5 ответов
+ 3
Replace the left parenthesis with (.
The problem is that the left parenthesis is some other character. It looks italisized, or something like that.
Having those parethesis themselves isn't an issue though.
I assume you copy and pasted it from somewhere else, whether or not you wrote the code. Sometimes those things can happen.
(It's also an infinite loop)
+ 2
1. Syntax error: (a<b)? You need to change first symbol to correct '('
2. Infinity loop because a>b always:
93>25 => a=b=25
a = 25 + 25 = 50
50>25 => a=b=25
...and again...
+ 1
Just remove the ( Brackets )
Then your code is supposed to work :)
+ 1
thanks all of you
0
So what is wrong ?
Is there a error or a unexpected output ?