0% found this document useful (0 votes)
21 views2 pages

Fib Bonacci

This document contains C# code examples demonstrating various C# language features including variables, conditional statements, operators, switch statements, labels, random number generation, and Fibonacci sequence generation. The code contains commented out examples and documentation comments.

Uploaded by

kidusbelete019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Fib Bonacci

This document contains C# code examples demonstrating various C# language features including variables, conditional statements, operators, switch statements, labels, random number generation, and Fibonacci sequence generation. The code contains commented out examples and documentation comments.

Uploaded by

kidusbelete019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

using System;

namespace Grammer
{
class program
{
public static void Main(string[] args)
{

//Console.WriteLine("Hello, World!");
//double heightInMeters = 1.88;
//Console.WriteLine($"the variable is {nameof(heightInMeters)} and the
height {(heightInMeters)}");
//string firstname = "sami";
//string lastname = "end";
//string phonenumber = "251 912 34 56 78 ";
//Console.WriteLine($"my name is {firstname + " " + lastname}" + $" my
phone number is {phonenumber}");

//double a = 0.1;
//double b = 0.2;
//if( a+b == 0.3)
//{
// Console.WriteLine($"{a} + {b} is equal to {0.3}");
//}
//else
//{
// Console.WriteLine($"{a} + {b} is not equal to
{0.300000000000000004}");
//}

/*int numberOfApple = 12;


*decimal pricePerApple = 0.35M;
*Console.WriteLine(Format: "{0} apple cost {1:C}",arg0:
numberOfApple,arg1: pricePerApple * numberOfApple);
*string formatted = string.Format(format: "{0} apple costs" + "{1:C}",
arg0: numberOfApple, arg1: pricePerApple* numberOfApple);
*Console.WriteLine(formatted);
*/

//int a = 10;

//console.writeline($"a << 3 = {a << 3}");


//console.writeline($"a * 8 = {a*8}");
//console.writeline($"b >> 1 = {a >> 1}");

//Object o = "3";
//int k = 4;
//if(o is k)
//{
// Console.WriteLine("equal");
//}
//else
//{
// Console.WriteLine("not Equal");
//}

// int number = (new Random()).Next(1, 7);


// switch(number)
// {
// case 1:
// Console.WriteLine("ONE");
// break;
// case 2:
// Console.WriteLine("TWO");
// goto case 1;
// case3:
// case4:
// Console.WriteLine("three and four");
// goto case 1;
// case 5:
// goto NameLable;
// break;
// default:
// Console.WriteLine("not selected");
// break;
// }
//NameLable:
// Console.WriteLine("name lable");

//int cardNumber = (new Random()).Next(11,14);


//string suit = "clobs";
//string cardName = (cardNumber, suit) switch
//{
// 13 and "clobs" => "King",
// 12 => "Queen",
// 11 => "Jack",
// _ => "Pip card"
//};

// fibonacci

//for(int i = 0, num1 = 1, num2 =1; i < 10; i++)


//{
// Console.Write(num1 + " ");
// int num3 = num1 + num2;
// num1 = num2;
// num2 = num3;
//}string[]

//Console.ReadKey();
}

}
}

You might also like