What is the reason for the error here? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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

24th Sep 2022, 11:03 AM
Fırat Ɩzel
Fırat Ɩzel - avatar
3 Respostas
+ 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...
24th Sep 2022, 11:23 AM
Jayakrishna šŸ‡®šŸ‡³
+ 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šŸ˜€šŸ‘šŸ»
24th Sep 2022, 11:41 AM
Fırat Ɩzel
Fırat Ɩzel - avatar
+ 2
šŸ™&šŸ‘ You're welcome..
24th Sep 2022, 1:06 PM
Jayakrishna šŸ‡®šŸ‡³