Adv C#
Programming


C# program tutorials using out parameter ie returning more than one parameter back to the caller method
|
Example: C# program using out parameter ie returning more than one parameter back to the caller method |
|
/* C# program using out parameter ie returning more than one parameter back to the caller method */using System;class SepDec{public static void Main(){Console.Write("Enter Number : ");float num = float.Parse(Console.ReadLine());float integral;float dec;Sep(num, out integral, out dec);Console.WriteLine("Integral: " + integral);Console.WriteLine("Decimal: " + dec);}public static void Sep(float num, out float integral, out float dec){integral = (float)Math.Floor(num);dec = num - integral;}} |
Output |
Enter Number : 25.33Integral: 25Decimal: 0.3299999 |