using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { // type casting = Converting a value to a different data type // Useful when we accept user input (string) // Different data types can do different things double a = 3.14; int b = Convert.ToInt32(a); int c = 123; double d = Convert.ToDouble(c); int e = 321; String f = Convert.ToString(e); String g = "$"; char h = Convert.ToChar(g); String i = "true"; bool j = Convert.ToBoolean(i); Console.WriteLine(b.GetType()); Console.WriteLine(d.GetType()); Console.WriteLine(f.GetType()); Console.WriteLine(h.GetType()); Console.WriteLine(j.GetType()); Console.ReadKey(); } } }
So I am a C++ programmer that still uses a little C. My work gave me an offer to go help out another department. My department sorts mail, and the other department does full stack development. They use C# and I have been dragging my feet for years to learn it. Now that I actually am going to be a step closer to my dream I am taking it serious now to learn c#.
I haven't watched the video yet, but I heard that "Oh yeah", scrolled down and saw the channel avatar and name, immediately hit that subscribe button. It became clear to me at this moment, this is no ordinary channel, this is a man's channel. This is the kind of channel you go to when your masculinity is overpowering you and needs to be released through pure unadulterated logic. I already know that by watching your videos, my brain is going to be forming new connections that function as if they were created through the use of organic steroids formulated from the biological specimens of subjects that would make Arnold Schwarzenegger and Randy Savage weep tears of estrogen and pass winds of talcum powder and floral scented air sanitizer. This might sound a bit like a joke, but that's just how I put my thoughts into words. My mind and body is ready. I'll watch the video now.
using System;
namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
// type casting = Converting a value to a different data type
// Useful when we accept user input (string)
// Different data types can do different things
double a = 3.14;
int b = Convert.ToInt32(a);
int c = 123;
double d = Convert.ToDouble(c);
int e = 321;
String f = Convert.ToString(e);
String g = "$";
char h = Convert.ToChar(g);
String i = "true";
bool j = Convert.ToBoolean(i);
Console.WriteLine(b.GetType());
Console.WriteLine(d.GetType());
Console.WriteLine(f.GetType());
Console.WriteLine(h.GetType());
Console.WriteLine(j.GetType());
Console.ReadKey();
}
}
}
Convert.ToInt32() - is not truncating, but rounding
@@vagifgafar2946 then use
Convert.ToInt32(Decimal.Round(value, 0, MidpointRounding.ToZero)); since Visual Studio 2022
}
I Learned C# From your channel got a job in Fullstack web developer at Cognizant.
Thank you Bro😍😍
I have been recommending this channel too so many people in my classes, they all love the content, keep up the great content
Bro i absolutely love how clear and clean your method of teaching is 🙏
One best tutor around here in youtube, i watched your java form video, please can you make wpf c# tutorial as well.
So I am a C++ programmer that still uses a little C. My work gave me an offer to go help out another department. My department sorts mail, and the other department does full stack development. They use C# and I have been dragging my feet for years to learn it. Now that I actually am going to be a step closer to my dream I am taking it serious now to learn c#.
Nice video 👍👍😊
Nice video
Thank you for simplicity
best tutorial channel
This dude. Is a legend.
Is it bad practice using only the keywords, for primitive datatypes, to cast?
double pi = 3.14;
int a = (int)pi;
But string is not a primitive Datatype.
I haven't watched the video yet, but I heard that "Oh yeah", scrolled down and saw the channel avatar and name, immediately hit that subscribe button. It became clear to me at this moment, this is no ordinary channel, this is a man's channel. This is the kind of channel you go to when your masculinity is overpowering you and needs to be released through pure unadulterated logic. I already know that by watching your videos, my brain is going to be forming new connections that function as if they were created through the use of organic steroids formulated from the biological specimens of subjects that would make Arnold Schwarzenegger and Randy Savage weep tears of estrogen and pass winds of talcum powder and floral scented air sanitizer. This might sound a bit like a joke, but that's just how I put my thoughts into words. My mind and body is ready. I'll watch the video now.
What
Preciate the video fam🤗
Thank you a lot,I really gained well
Thank you
Thanks for the video Bro
Thanks!
You have any projects for c#?
droppin a comment for that algorithm!
thanks
Bool is Cool
If the user input consist of numbers and sentences, do you have to convert it into a string ?
Yeah (I believe )
yup..
noice
comment for algorithm!!!
lesson check😇
didnt you first use VS code now this like is this a mandela effect
I like pizza
Same
bro code
hahahahaha gString...
fart