AmitDiwan has Published 10740 Articles

How to change the CursorTop of the Console in C#?

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:21:53

247 Views

To change the CursorTop of the Console in C#, use the Console.CursorTop propertyExampleLet us now see an example −using System; class Demo {    public static void Main (string[] args) {       Console.BackgroundColor = ConsoleColor.Blue;       Console.WriteLine("Background color changed = "+Console.BackgroundColor);       Console.ForegroundColor = ... Read More

How to change BufferHeight of the Console in C#?

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:19:06

158 Views

To change the BufferHeight of the Console, use the Console.BufferHeight property in C#.ExampleLet us now see an example −using System; class Demo {    public static void Main (string[] args) {       Console.BufferHeight = 200;       Console.WriteLine("Buffer Height = "+Console.BufferHeight);    } }OutputThis will produce the following output −Buffer Height = 200

How to change the Background Color of Text in C# Console

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:16:05

2K+ Views

To change the background color of text in Console, use the Console.BackgroundColor Property in C#.ExampleLet us now see an example −using System; class Demo {    public static void Main (string[] args) {       Console.BackgroundColor = ConsoleColor.Blue;       Console.WriteLine("Background color changed = "+Console.BackgroundColor);    } }OutputThis will produce the following output −

MathF.Exp() Method in C# with Examples

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:13:38

120 Views

The MathF.Exp() method in C# returns the raised to the specified power.SyntaxFollowing is the syntax −public static float Exp (float val);Above, Val is the floating-point number.ExampleLet us now see an example to implement the MathF.Exp() method −using System; class Demo {    public static void Main(){       float ... Read More

MathF.Cosh() Method in C# with Examples

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:11:16

86 Views

The MathF.Cosh() method in C# is used to return the hyperbolic cosine of a floating-point value.SyntaxFollowing is the syntax −public static float Cosh (float val);Above, Val is the floating-point number.ExampleLet us now see an example to implement the MathF.Cosh() method −using System; class Demo {    public static void Main(){ ... Read More

MathF.Cos() Method in C# with Examples

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:10:02

146 Views

The MathF.Cos() method in C# returns the cosine of a given float value argument.SyntaxFollowing is the syntax −public static float Cos (float val);Above, Val is the floating-point value.ExampleLet us now see an example to implement the MathF.Cos() method −using System; class Demo {    public static void Main(){     ... Read More

Uri.IsHexDigit() Method in C#

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:07:36

131 Views

The Uri.IsHexDigit() method in C# determines whether a specified character is a valid hexadecimal digit.SyntaxFollowing is the syntax −public static bool IsHexDigit (char ch);Above, the parameter ch is the character to validate.ExampleLet us now see an example to implement the Uri.IsHexDigit() method −using System; public class Demo {    public ... Read More

Copying the Queue elements to one-dimensional array in C#

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:05:49

244 Views

Queue.CopyTo(T[], Int32) Method is used to copy the Queue elements to a 1-D array.ExampleLet us now see an example −using System; using System.Collections.Generic; public class Demo{    public static void Main(){       Queue queue = new Queue();       queue.Enqueue("K");       queue.Enqueue("T");       ... Read More

Console.SetBufferSize() Method in C#

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 06:03:30

299 Views

The Console.SetBufferSize() Method in C# is used to set the height and width of the screen buffer area to the specified values.SyntaxThe syntax is as follows −public static void SetBufferSize (int width, int height);Above, the parameter width is the width of the buffer area, whereas height is the height of ... Read More

Console.ResetColor() Method in C#

AmitDiwan

AmitDiwan

Updated on 14-Nov-2019 05:58:19

394 Views

The Console.ResetColor() method in C# is used to set the foreground and background console colors to their defaults.SyntaxThe syntax is as follows −public static void ResetColor ();ExampleLet us now see an example to implement the Console.ResetColor() method in C# −using System; class Demo {    public static void Main (string[] ... Read More

Advertisements