Город МОСКОВСКИЙ
00:03:35

C# return keyword ↩️

Аватар
JavaScript Легко и Просто
Просмотры:
23
Дата загрузки:
29.11.2023 17:19
Длительность:
00:03:35
Категория:
Технологии и интернет

Описание

C# return keyword tutorial example explained

#C# #return #keywords

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
// return = returns data back to the place where a method is invoked

double x;
double y;
double result;

Console.WriteLine("Enter in number 1: ");
x = Convert.ToDouble(Console.ReadLine());

Console.WriteLine("Enter in number 2: ");
y = Convert.ToDouble(Console.ReadLine());

result = Multiply(x, y);

Console.WriteLine(result);

Console.ReadKey();
}
static double Multiply(double x, double y)
{
return x * y;
}
}
}

Рекомендуемые видео