0
Help me find an error in the code
3 Answers
+ 1
The error in the code is that, the last curly braces "}" are extra and unnecessary, this is causing the code to not run properly.
It should be removed from the end to run the code without any error.
Also, there is a missing function call 'ReadInteger()' which is used in the code, it should be defined before using it.
0
your code does not have a Main() function which is the starting point of the execution .
and missing Program class
n = ReadInteger() doesn't exist
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sololearn
{
class Program
{
//put your classes here
static void Main(string[] args) //missing this
{
//your exec code here
}
}
}
0
My answer is 1 + 2. A program class with public static void main is required to instantiate and use objects. Refer to the Java format, it's almost ditto. use proper indenting. There are unmatched parenthesis.Learn Java when you learn C++.They are almost carbon copies. I have taken both the courses. Come back to me if you need any guidance...