0

Problem task on the C#

Please help me in my problem. My code below (怀ļ½„Ļ‰ļ½„)ā˜ž 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) { Console.Write(); int sum1 = Convert.ToInt32(Console.ReadLine()); Console.Write(); int sum2 = Convert.ToInt32(Console.ReadLine()); GetSum(); } static int GetSum(sum1,sum2) { return sum1 + sum2; } } }

8th May 2021, 2:50 PM
Kovalov Evgen
Kovalov Evgen - avatar
2 Answers
0
_į™¢Ē¾įˆŠį»¢Č”Ī˜Å¬_ Your method has return type integer so when you call method then you have to store returned value in a variable. And also you didn't passed parameters in calling method. So do this: int sum = GetSum(sum1, sum2);
8th May 2021, 3:18 PM
AĶ¢J
AĶ¢J - avatar
0
No
8th May 2021, 11:45 PM
Kovalov Evgen
Kovalov Evgen - avatar