Created
February 6, 2025 10:40
-
-
Save wingled22/bf80d4524781fe92e289f8fd02daac2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class HelloWorld { | |
static void Main() { | |
//variables : container sa value | |
// number / string / array / boolean(true||false) | |
// initialization : declaration sa unsay name sa var ug iyang type | |
// int age; | |
// double height; decimal price; float ambot; | |
// string firstname = "", middlename = ""; | |
// age = 18; //assignment | |
// string lastname = "my lastname"; | |
// string[] mgaUyabNiDags = ["Hana", "Ivy"]; | |
// int[] ages = [20, 21 ,22]; | |
// mgaUyabNiDags.Prepend("Asawa"); | |
// arithmetic operations | |
// + - / * ** % | |
// Console.WriteLine(5^3); | |
//conditional operation | |
// > < => =< == != === || && | |
//Console.WriteLine( "del" != "Del" ); | |
// Conditions | |
// age = 18; | |
// if(age >= 60) | |
// { | |
// Console.WriteLine("Pwede na mamatay"); | |
// } | |
// else if(age >= 18) | |
// { | |
// Console.WriteLine("Mapriso na"); | |
// } | |
// else | |
// { | |
// Console.WriteLine("Bata pa"); | |
// } | |
// string student = "Kevin"; | |
// // ternary condition | |
// string commentForStudent = student == "Kevin" ? "batig nawng" : "bayut"; | |
// Console.WriteLine(commentForStudent); | |
// // age = 16; | |
// string Remarks = age >= 18 ? "Legal age" : "minor"; | |
// Console.WriteLine(Remarks); | |
Console.WriteLine("Enter value"); | |
// string i = Console.ReadLine(); | |
// Console.WriteLine(i); | |
//decimal dcml = Convert.ToDecimal(Console.ReadLine()); | |
int i = Convert.ToInt32(Console.ReadLine()); | |
double dbl = Convert.ToDouble(Console.ReadLine()); | |
//Console.WriteLine("value of i : " + i + "\n value of dbl : " + dbl); | |
Console.WriteLine( $"value of i is {i} \nvalue of dbl is {dbl}" ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment