
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2587 Articles for Csharp

1K+ Views
The Math.Log() method in C# is used to return the logarithm of a specified number.Syntaxpublic static double Log(double num) public static double Log(double num, double base)Above, num is the specified number whose logarithm is to be calculated. Here, the base is the base of the logarithm.Let us now see an example to implement the Math.Log() method −Exampleusing System; public class Demo { public static void Main(){ double val1 = 2.15; double val2 = -2.15; Console.WriteLine(Math.Log(val1)); Console.WriteLine(Math.Log(val2)); } }OutputThis will produce the following output −0.765467842139571 NaNExampleLet us ... Read More

73 Views
The Math.IEEERemainder() method in C# is used to return the remainder resulting from the division of a specified number by another specified number.Syntaxpublic static double IEEERemainder (double dividend, double divisor);Let us now see an example to implement Math.IEEERemainder() method −Exampleusing System; public class Demo { public static void Main(){ double val1 = 90; double val2 = 7; // IEEE Remainder var rem = Math.IEEERemainder(val1, val2); Console.WriteLine(rem); } }OutputThis will produce the following output −-1Let us see another example to implement Math.IEEERemainder() method −Exampleusing ... Read More

91 Views
The Type.GetDefaultMembers() method in C# is used to search for the members defined for the current Type whose DefaultMemberAttribute is set.Syntaxpublic virtual System.Reflection.MemberInfo[] GetDefaultMembers ();Let us now see an example to implement the Type.GetDefaultMembers() method −Exampleusing System; using System.Reflection; [DefaultMemberAttribute("subject")] public class Demo { public static void Main(){ Type t = typeof(Demo); MemberInfo[] member = t.GetDefaultMembers(); if (member.Length != 0){ for (int i = 0; i < member.Length; i++) Console.WriteLine("{0}", member[i]); } else { ... Read More

107 Views
The Type.GetArrayRank() method in C# gets the number of dimensions in an array.Syntaxpublic virtual int GetArrayRank ();Let us now see an example to implement the Type.GetArrayRank() method −Exampleusing System; public class Demo { public static void Main(string[] args) { Type type = typeof(int[, , ]); int arrRank = type.GetArrayRank(); Console.WriteLine("Array Rank = {0}", arrRank); } }OutputThis will produce the following output −Array Rank = 3Let us now see another example to implement the Type.GetArrayRank() method −Exampleusing System; public class Demo { public static void Main(string[] args) { ... Read More

880 Views
The Type.Equals() method in C# determines if the underlying system type of the current Type is the same as the underlying system type of the specified Object or Type.Syntaxpublic virtual bool Equals (Type o); public override bool Equals (object o);Above, the parameters are the object whose underlying system type is to be compared with the underlying system type of the current Type.Let us now see an example to implement the Type.Equals() method −using System; public class Demo { public static void Main(string[] args) { Type val1 = typeof(System.UInt16); Type val2 = typeof(System.Int32); ... Read More

128 Views
The Tuple class represents a 7-tuple, which is called septet. A tuple is a data structure that has a sequence of elements.It is used in −Easier access to a data set.Easier manipulation of a data set.To represent a single set of data.To return multiple values from a methodTo pass multiple values to a methodIt has seven properties −Item1− Get the value of the current Tuple object's first component.Item2− Get the value of the current Tuple object's second component.Item3− Get the value of the current Tuple object's third component.Item4− Get the value of the current Tupleobject's fourth component.Item5− Get the value ... Read More

131 Views
The Tuple class represents a 6-tuple. A tuple is a data structure that has sequence of elements.It is used in −Easier access to a data set.Easier manipulation of a data set.To represent a single set of data.To return multiple values from a methodTo pass multiple values to a methodIt has six properties −Item1− Get the value of the current Tuple object's first component.Item2− Get the value of the current Tuple object's second component.Item3− Get the value of the current Tuple object's third component.Item4− Get the value of the current Tuple object's fourth component.Item5− Get the value of the current Tuple ... Read More

193 Views
The Tuple class represents a 5-tuple, which is called quintuple. A tuple is a data structure that has a sequence of elements.It is used in −Easier access to a data set.Easier manipulation of a data set.To represent a single set of data.To return multiple values from a methodTo pass multiple values to a methodIt has five properties −Item1− Get the value of the current Tuple object's first component.Item2− Get the value of the current Tuple object's second component.Item3− Get the value of the current Tuple object's third component.Item4− Get the value of the current Tuple object's fourth component.Item5− Get the ... Read More

3K+ Views
The Math.Floor() method in C# is used to return the largest integral value less than or equal to the specified number.Syntaxpublic static decimal Floor (decimal val); public static double Floor (double val)For the first syntax above, the value val is the decimal number, whereas Val in the second syntax is the double number.Let us now see an example to implement Math.Floor() method −Exampleusing System; public class Demo { public static void Main(){ decimal val1 = 7.10M; decimal val2 = -79.89M; Console.WriteLine("Result = " + Math.Floor(val1)); Console.WriteLine("Result = ... Read More

268 Views
The Math.Exp() method in C# is used to return e raised to the specified power.Syntaxpublic static double Exp (double val);Here, Val is the power.If Val equals NaN or PositiveInfinity, that value is returned. However, if d equals NegativeInfinity, 0 is returned.Let us now see an example to implement Math.Exp() method −Exampleusing System; public class Demo { public static void Main(){ Console.WriteLine(Math.Exp(0.0)); Console.WriteLine(Math.Exp(Double.PositiveInfinity)); Console.WriteLine(Math.Exp(Double.NegativeInfinity)); } }OutputThis will produce the following output −1 ∞ 0Let us see another example to implement Math.Exp() method −Exampleusing System; public class Demo { public ... Read More