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
ᙢᖇ.ᚪ ᚱ ع ℰ 爪 Ꭿ ກ
ᙢᖇ.ᚪ ᚱ ع ℰ 爪 Ꭿ ກ - avatar
2 Respostas
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
ᙢᖇ.ᚪ ᚱ ع ℰ 爪 Ꭿ ກ
ᙢᖇ.ᚪ ᚱ ع ℰ 爪 Ꭿ ກ - avatar