{"id":95,"date":"2021-12-22T11:25:18","date_gmt":"2021-12-22T04:25:18","guid":{"rendered":"https:\/\/csharptutorial.net\/?page_id=95"},"modified":"2022-12-29T15:06:39","modified_gmt":"2022-12-29T08:06:39","slug":"csharp-variables","status":"publish","type":"page","link":"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-variables\/","title":{"rendered":"C# Variables"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn about C# variables including declaring variables, assigning values to variables, and displaying variables in the console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to the C# variables<\/h2>\n\n\n\n<p>Programs process data. Typically, They work as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, get data from user inputs, files, or third-party API.<\/li>\n\n\n\n<li>Second, process the data. <\/li>\n\n\n\n<li>Third, output the result to the screen or save it to data storage such as a file or database.<\/li>\n<\/ul>\n\n\n\n<p>To store data during the execution of the program, you use variables. <\/p>\n\n\n\n<p>By definition, variables are identifiers whose values can change during the program&#8217;s execution. When the program ends, the values stored in the variables are also gone.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Declare variables<\/h3>\n\n\n\n<p>Before using a variable, you need to declare it using the following syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">type variableName;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>type<\/code> can be any C# built-in type or custom type. For example, the <code>int<\/code> built-in type represents the integers, and the <code>string<\/code> built-in type represents the text strings. Note that you&#8217;ll learn about the custom types later.<\/li>\n\n\n\n<li>The <code>variableName<\/code> is a valid identifier that starts with a character or underscore (_) and is followed by other characters.<\/li>\n<\/ul>\n\n\n\n<p>The following table illustrates the most commonly used built-in types:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Type<\/th><th>Meaning<\/th><th>Examples<\/th><\/tr><\/thead><tbody><tr><td>int<\/td><td>Integers<\/td><td>1, 2, 3<\/td><\/tr><tr><td>float<\/td><td>Single-precision floating-point numbers <\/td><td>1.1F<\/td><\/tr><tr><td>double<\/td><td>Double-precision floating-point numbers<\/td><td>2.5<\/td><\/tr><tr><td>string<\/td><td>Text strings<\/td><td>&#8220;Hi&#8221;<\/td><\/tr><tr><td>char<\/td><td>Characters<\/td><td>&#8216;a&#8217;, &#8216;b&#8217;,&#8217;c&#8217;<\/td><\/tr><tr><td>bool<\/td><td>boolean values<\/td><td>true, false<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>By convention, variable names are in the camel case and start with a letter. For example <code>color<\/code>, <code>textColor<\/code>, and <code>backgroundColor<\/code>.<\/p>\n\n\n\n<p>The following example declares a variable <code>age<\/code> with the type <code>int<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">int<\/span> age;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When you declare a variable, it is initially unassigned. If you attempt to read from an unassigned variable, the compiler will issue an error. <\/p>\n\n\n\n<p>After declaring a variable, you can assign a value to it using the assignment operator (<code>=<\/code>), like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">int<\/span> age;\nage = <span class=\"hljs-number\">18<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>And you can do both steps using one statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">int<\/span> age = <span class=\"hljs-number\">18<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following increases the value of the age variable by one:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">int<\/span> age = <span class=\"hljs-number\">18<\/span>;\nage = age + <span class=\"hljs-number\">1<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>After the second statement, the value of age is 19.<\/p>\n\n\n\n<p>C# is a type-safe language. It means that the compiler will ensure that the variable will always store a value of the declared type. <\/p>\n\n\n\n<p>In the above example, the age variable will always store an integer. If you assign it a string, the compiler will issue an error.<\/p>\n\n\n\n<p>The following code will result in an error when compiling:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">int<\/span> age;\nage = <span class=\"hljs-string\">\"one\"<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">error CS0029: Cannot implicitly convert type <span class=\"hljs-string\">'string'<\/span> to <span class=\"hljs-string\">'int'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Display variables<\/h3>\n\n\n\n<p>To output the <code>age<\/code> variable to the console, you use the <code>Console.WriteLine<\/code> method as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">int<\/span> age = <span class=\"hljs-number\">18<\/span>;\nConsole.WriteLine(age);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">The age <span class=\"hljs-keyword\">is<\/span> <span class=\"hljs-number\">18<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To embed the <code>age<\/code> variable in a string and display it, you use the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">Console.WriteLine(<span class=\"hljs-string\">$\"The age is <span class=\"hljs-subst\">{age}<\/span>\"<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this statement:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, prefix the string with the <code>$<\/code> symbol.<\/li>\n\n\n\n<li>Second, place the variable (<code>age<\/code>) inside the curly braces <code>{}<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>When the compiler sees a string with the $ prefix, it&#8217;ll replace all the variables in the curly braces with their corresponding values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Declare multiple variables<\/h3>\n\n\n\n<p>To declare multiple variables, you use multiple statements:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">double<\/span> weight = <span class=\"hljs-number\">60.5<\/span>;\n<span class=\"hljs-keyword\">double<\/span> height = <span class=\"hljs-number\">1.72<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Note that the <code>double<\/code> type represents the double-precision floating-point numbers.<\/p>\n\n\n\n<p>If variables have the same type, you can declare them in one statement and use a comma (,) to separate two variables like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">double<\/span> weight = <span class=\"hljs-number\">60.5<\/span>,\n       height = <span class=\"hljs-number\">1.72<\/span>;\n\nConsole.WriteLine(<span class=\"hljs-string\">$\"The weight is <span class=\"hljs-subst\">{weight}<\/span>kg and height is <span class=\"hljs-subst\">{height}<\/span>m\"<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">The weight is 60.5kg and height is 1.72m<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">C# variable example<\/h2>\n\n\n\n<p>The following program illustrates how to use variables to calculate the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Body_mass_index\" target=\"_blank\" rel=\"noreferrer noopener\">body mass index<\/a>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">double<\/span> weight = <span class=\"hljs-number\">60.5<\/span>,\n       height = <span class=\"hljs-number\">1.72<\/span>,\n       bmi;\n\n<span class=\"hljs-comment\">\/\/ calculate BMI<\/span>\nbmi = weight \/ (height * height);\n\n<span class=\"hljs-comment\">\/\/ output<\/span>\nConsole.WriteLine(<span class=\"hljs-string\">\"Calculate Body Mass Index (BMI)\"<\/span>);\nConsole.WriteLine(<span class=\"hljs-string\">$\"Weight: <span class=\"hljs-subst\">{weight}<\/span>kg\"<\/span>);\nConsole.WriteLine(<span class=\"hljs-string\">$\"Height: <span class=\"hljs-subst\">{height}<\/span>m\"<\/span>);\nConsole.WriteLine(<span class=\"hljs-string\">$\"BMI: <span class=\"hljs-subst\">{bmi:<span class=\"hljs-number\">0.<\/span>#}<\/span>\"<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">Calculate Body Mass Index (BMI)\nWeight: 60.5kg\nHeight: 1.72m\nBMI: 20.5<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>How it works.<\/p>\n\n\n\n<p>First, declare three variables <code>weight<\/code>, <code>height<\/code>, and <code>bmi<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">double<\/span> weight = <span class=\"hljs-number\">60.5<\/span>,\n       height = <span class=\"hljs-number\">1.72<\/span>,\n       bmi;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, calculate the body mass index (BMI) and store the result in the <code>bmi<\/code> variable:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-17\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-comment\">\/\/ calculate BMI<\/span>\nbmi = weight \/ (height * height);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-17\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, show the output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-18\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-comment\">\/\/ output<\/span>\nConsole.WriteLine(<span class=\"hljs-string\">\"Calculate Body Mass Index (BMI)\"<\/span>);\nConsole.WriteLine(<span class=\"hljs-string\">$\"Weight: <span class=\"hljs-subst\">{weight}<\/span>kg\"<\/span>);\nConsole.WriteLine(<span class=\"hljs-string\">$\"Height: <span class=\"hljs-subst\">{height}<\/span>m\"<\/span>);\nConsole.WriteLine(<span class=\"hljs-string\">$\"BMI: <span class=\"hljs-subst\">{bmi:<span class=\"hljs-number\">0.<\/span>#}<\/span>\"<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-18\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Note that the following syntax formats the BMI value that will show one digit after the decimal point:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-19\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">{bmi:<span class=\"hljs-number\">0.<\/span><span class=\"hljs-meta\">#}<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-19\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If you want to format a number with more digits after the decimal point, you can add more of the <code>#<\/code> symbol. Each <code>#<\/code> symbol represents a number.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Variables are identifiers whose values change during the execution of a program.<\/li>\n\n\n\n<li>By convention, variable names are in the camel case.<\/li>\n\n\n\n<li>Use variables to store data in the program.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"95\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-variables\/\"\n\t\t\t\tdata-post-title=\"C# Variables\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"95\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-tutorial\/csharp-variables\/\"\n\t\t\t\tdata-post-title=\"C# Variables\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: in this tutorial, you&#8217;ll learn about C# variables including declaring variables, assigning values to variables, and displaying variables in the console. Introduction to the C# variables Programs process data. Typically, They work as follows: To store data during the execution of the program, you use variables. By definition, variables are identifiers whose values can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":7,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-95","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/95","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":5,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/95\/revisions"}],"predecessor-version":[{"id":737,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/95\/revisions\/737"}],"up":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/7"}],"wp:attachment":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/media?parent=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}