Whats wrong with this code?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Whats wrong with this 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) { string value; int numb,evennum,oddnum; Console.WriteLine( "Enter 20 integer"); value=(Console.ReadLine(); numb=int.parse(value); evennum=0; oddnum =0; { for(int i=0;i<numb;i++) if (numb%2==0) { evennum++; } else { oddnum++; } } Console.WriteLine("Total even number",+evennum); Console.WriteLine("Total odd number",+oddnum); Console.ReadLine (); } } }

30th Sep 2019, 7:04 PM
Muleem Anjum
Muleem Anjum - avatar
8 Answers
+ 3
Muleem Anjum you're missing a closing parentheses ")" in lines 18,34
30th Sep 2019, 7:40 PM
Jella
Jella - avatar
+ 2
Play ground (17,34) error
30th Sep 2019, 7:15 PM
Muleem Anjum
Muleem Anjum - avatar
+ 2
Thanks dear hope its work now :) well let me know any issue with line 18?? Plz if you dont mind
30th Sep 2019, 7:22 PM
Muleem Anjum
Muleem Anjum - avatar
+ 2
No i dont think so :-/
30th Sep 2019, 7:51 PM
Muleem Anjum
Muleem Anjum - avatar
+ 2
Muleem Anjum I think so. value=(Console.ReadLine(); close the second bracket like this value=(Console.ReadLine());
30th Sep 2019, 7:55 PM
Jella
Jella - avatar
+ 1
Muleem Anjum remove extra "(" parentheses after equal sign in line 17
30th Sep 2019, 7:18 PM
Tahir Iqbal
Tahir Iqbal - avatar
0
What error raised in output?
30th Sep 2019, 7:12 PM
Tahir Iqbal
Tahir Iqbal - avatar
0
Close it or remove first one, same condition...! But if you write like this value = Console.ReadLine(); It will be better 👍🏻
30th Sep 2019, 8:57 PM
Tahir Iqbal
Tahir Iqbal - avatar