C# Math class 📏

preview_player
Показать описание
C# math class methods tutorial example explained

#C# #Math #methods

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{

double x = 3;
double y = 5;

double a = Math.Pow(x, 2);
double b = Math.Sqrt(x);
double c = Math.Abs(x);
double d = Math.Round(x);
double e = Math.Ceiling(x);
double f = Math.Floor(x);
double g = Math.Max(x, y);
double h = Math.Min(x, y);

Console.WriteLine(a);

Console.ReadKey();
}
}
}
Рекомендации по теме
Комментарии
Автор

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{

double x = 3;
double y = 5;

double a = Math.Pow(x, 2);
double b = Math.Sqrt(x);
double c = Math.Abs(x);
double d = Math.Round(x);
double e = Math.Ceiling(x);
double f = Math.Floor(x);
double g = Math.Max(x, y);
double h = Math.Min(x, y);

Console.WriteLine(a);

Console.ReadKey();
}
}
}

BroCodez
Автор

This single video managed to provide a better explanation of math concepts in 5 minutes than my school did in a year.

jackjshorts
Автор

I'm on a bro code binge right now. So far so good. Like the short and concise content

omgcrazee
Автор

3:44 That's my professors method to correct all my tests...

I'm glad i've found a good tutorial for learning basics of C#, I was surprised when I saw your views on theses videos. I'm so bad at math, I didn't practice since 6 years now... Good work on your videos ! Very usefull and simple to learn. Thank you :)

yuriky
Автор

So basic, precise and straight to the point, thanks a lot! 😊

reniside
Автор

Thank you so much for the video bro, it was really helpful

shuttersup
Автор

My online college course for this is horrid. We just read a book and try and code. I appreciate these videos immensely.

keegan
Автор

Thank you very much you are the best 😘💗😘💗😘💗

olgatalas
Автор

Thanks for sharing your knowledge!
straight to the point!

But... I was trying the codes on VS, and every time I put double x = 2.5; and the put double etc = Math.Round(x); anything with number.number, the VS gets crazy and broke the code, on terminal it says: Failed build, and on the window problems, says I canot use double or float. lol

So I needed to use int for whole numbers and double for those: Math.Pow, Math.Sqrt, Abs, Max, Min.

Idk if someone could help me lol

rebecafelix
Автор

ty bro, my emglish is bad, but i have understoot every word <3

andreysomich
Автор

Would floats work in this code when doing these calculations? What's the main difference between floats and doubles other than the maximum memory size and maximum number used? Would you have to put an f after each variable inside of the constructor parentheses?

gidkid
Автор

i run it in vs code the syntax doesnt work why?

FallenLarsa