Created
June 21, 2023 18:18
-
-
Save AmirMahdyJebreily/b5087b28e7b09367248056106a489943 to your computer and use it in GitHub Desktop.
Revisions
-
AmirMahdyJebreily created this gist
Jun 21, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ // Code Agha => https://github.com/AmirMahdyJebreily Console.Write("Enter dads count here : "); Console.ForegroundColor = ConsoleColor.Cyan; int count = int.Parse(Console.ReadLine()); int[] dads = new int[count]; Console.ResetColor(); Console.WriteLine(); for (int i = 0; i < count; i++) { Console.Write($"\tEnter dad no.{i} here : "); Console.ForegroundColor = ConsoleColor.Cyan; dads[i] = int.Parse(Console.ReadLine()); Console.ResetColor(); } // کیسه float sum = 0; foreach (int dad in dads) { sum += dad; } float avg = (float)(sum / count); Console.WriteLine($"\n\nSum is : {sum}"); Console.WriteLine($"Avg is : {avg}"); // int.Parse(string); float.Parse(string); // float & double & decimal // $"Hello {kobra}" // (float)(sum / count) // float => int : 1/999999999 => 1 // string ×> int : "abc123" => ????