17th Jan 2023, 2:15 PM
ŠŠ»ŠøŠ½Š° ŠšŠ¾Š½ŃŒŠŗŠ¾Š²Š°
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.
18th Jan 2023, 5:51 AM
Deepak
Deepak - avatar
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 } } }
17th Jan 2023, 5:10 PM
Bahhaāµ£
Bahhaāµ£ - avatar
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...
18th Jan 2023, 5:16 PM
Sanjay Kamath
Sanjay Kamath - avatar