C# variables ✖️

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

#C #variables #tutorial

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
int x; // declaration
x = 123; // initialization

int y = 321; // declaration + initialization

int z = x + y;

int age = 21; // whole integer
double height = 300.5; // decimal number
bool alive = false; //true or false
char symbol = '@'; // single character
String name = "Bro"; // a series of characters

Console.WriteLine("Hello " + name);
Console.WriteLine("Your age is " + age);
Console.WriteLine("Your height is " + height + "cm");
Console.WriteLine("Are you alive? " + alive);
Console.WriteLine("Your symbol is: " + symbol);

String userName = symbol + name;

Console.WriteLine("Your username is: " + userName);

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

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
int x; // declaration
x = 123; // initialization

int y = 321; // declaration + initialization

int z = x + y;

int age = 21; // whole integer
double height = 300.5; // decimal number
bool alive = false; // true or false
char symbol = '@'; // single character
String name = "Bro"; // a series of characters

Console.WriteLine("Hello " + name);
Console.WriteLine("Your age is " + age);
Console.WriteLine("Your height is " + height + "cm");
Console.WriteLine("Are you alive? " + alive);
Console.WriteLine("Your symbol is: " + symbol);

String userName = symbol + name;

Console.WriteLine("Your username is: " + userName);

Console.ReadKey();
}
}
}

BroCodez
Автор

as someone with a low attention span i find it much easier to focus & retain info on all these short 10min videos compared to the 12 hour long ones crammed full of information! great work

ronjohnson
Автор

This dude is a godsend, I was struggling with C# at college and these vids make it so simple

elliotradley
Автор

awesome tutorial. I am a 60 year old new programmer from toronto, newcity and really like these tutorials.

HistoricalHorizonsT
Автор

this is fantastic!
These are much less confusing than the official c# tutorials!

alex.g
Автор

i found programming so hard until i watch Brocode W content bro

LovilJacob
Автор

Talking about pizza, here's a fun fact; Those who say pineapples don't belong in pizza, has never tried them with pizza.

sandarubandara
Автор

Totally AWESOME tutorials. God Bless You in a special way today :) ✨✨✨✨✨✨👍👍👍👍

jonlbs
Автор

Giving up my programming because of a burnout, you are helping me picking up my pace again. Thank you so much BroCode you are god sent.

gillesherpoel
Автор

That's was actually a really good explanation

princephillipsashes
Автор

4:00 when she's telling you about her checklist in a guy

ashkelly
Автор

Sit back! Relax! is much needed BRooo!!

kowshik
Автор

If only it were that simple. When trying to transfer my program from pascal to c# win app, seemed to need things like: static, private, new . . . with the variables. Got it running in the end but didn't really know what I was doing.

firstlast
Автор

I learnt a little bit of java then switched to c# cause i wanna be a game dev in unity and WOW the similarities of java and c# code is Insane im very Surprised how same it is

zedch
Автор

Cool thing I made

using System;

namespace Program;

internal class Program
{
static void Main(string[] args)
{
int Age = 43; //How old u are
int been = 38; // How many days it's been sice your birthday
int days = Age * 365 + been; // Calculating the amount of days you've lived

Console.WriteLine("You have lived for " + days);
Console.WriteLine("days");

Console.ReadKey();
}
}

CodyLovesVR
Автор

7:36 why is his string data type different than ours ???
I use string he used String.

manikghosh
Автор

Love this video but for some reason when I followed along, I could not get my symbol or "Hey Bro" to display in the output console. Even after I copy and pasted the code you typed in the description. Did just update and download almost every package available for Visual Studio too. Maybe I have conflicting hubs/extensions?

TommySutherland-rycp
Автор

I came to learn c# from this channel after purchasing more than 10 udemy courses 🤣😂

designnimbus
Автор

A beginner here. If "Double" can store numbers with decimals while "Int" doesn't, why use Int at all and not just use Double just in case?

Same goes for Char and String. You could just use String with a single character right? What is the advantage of Char over String?

Umgrut
Автор

double height = true; would double my height

Perndoe