+ 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 Réponses
+ 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
Muhammad Tahir Iqbal
Muhammad Tahir Iqbal - avatar
0
What error raised in output?
30th Sep 2019, 7:12 PM
Muhammad Tahir Iqbal
Muhammad 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
Muhammad Tahir Iqbal
Muhammad Tahir Iqbal - avatar