C# return keyword ↩️

preview_player
Показать описание
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;
}
}
}
Рекомендации по теме
Комментарии
Автор

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 =

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

result = Multiply(x, y);

Console.WriteLine(result);

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

BroCodez
Автор

string comment = "This is a random comment";
Console.WriteLine(comment);
Console.ReadLine();

michaeljoshsarmiento
Автор

You know men, it's amazing... I am from Russia, i understand you better than from Russian YouTube channels, although i don't know English well...🤣

yusupadilson
Автор

You are a legend! Clear, comprehensive and to the point!

yosefabramov
Автор

Thanks bro, you're a life saver!

costim
Автор

Sir, i have a question that nobody answered me so i could finally umderstand.
Why return needs to be used?
I mean, it makes no sense to me.

apertaplays
Автор

Great short video, I finally understood the return thingy

daviceconelo
Автор

double and float.... are they the same ?

Ryöken
Автор

I'm trying use a method to change variables outside the method, and I have no idea why it's not working

tselhamishac
Автор

random comment:
"The dog has no nose."
"How did it smell?"
"Terrible."

gamersresidence
Автор

Wiat so if you returned x instead of z would result = x?

dontboyr
Автор

bro code helpd mein python and c++ and now c# but the reutn method i understand now but when to use it?

khaledwaleed
Автор

Marvel snap adds got me twerking fr fr 💣🍑

terryterry