+ 1
What is the reason for the error here?
I am getting "Identifier expected" error. Issue not resolved even though I value classes https://code.sololearn.com/c9SzrsFs7NIv/?ref=app
3 ответов
+ 2
int x,y,add,multiply,subtract,divide; // this simple statement should not be inside namespace. Add in class
public static class Calculator
{
public static Add(x,y) // return type is missing...
Either use void and dont return anything. Or use int return type..
And it is method definition, sholud include types for x, y
{
...
Correct way for single Add method :
public static class Calculator
{
static int add,multiply,subtract,divide;
public static void Add(int x,int y)
{
add = x + y;
Console.WriteLine("Toplama Islemi= "+add);
}
}
You can modify same way other methods... Hope it helps...
+ 3
Jayakrishna🇮🇳 I did what you said and it worked. Thank you very much for helping me find the error🙏🏻 Indians are really experts in the field of software😀👍🏻
+ 2
🙏&👍
You're welcome..