karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 56 of 143

Decimal constants in C#

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 3K+ Views

Decimal type has constants to get the minimum and maximum values.Set a decimal value −decimal d = 5.8M;To get the minimum and maximum values of the decimal type, use the following properties −decimal.MaxValue decimal.MinValueHere is the complete code −Exampleusing System; using System.Linq; class Demo {    static void Main() {       decimal d = 5.8M;       Console.WriteLine(d);       Console.WriteLine("Maximum Value: "+decimal.MaxValue);       Console.WriteLine("Maximum Value: "+decimal.MinValue);    } }Output5.8 Maximum Value: 79228162514264337593543950335 Maximum Value: -79228162514264337593543950335

Read More

C# Program to check if a number is Positive, Negative, Odd, Even, Zero

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 2K+ Views

Check for the following conditions −For odd and even, check for the remainder when the number is divided by 2 −// checking for odd/ even if(n % 2 == 0) {    Console.WriteLine("Even"); } else {    Console.WriteLine("Odd"); }For positive, negative and checking whether a number is 0 or not −if (n < 0) { Console.WriteLine("Negative Number!"); } else if(n == 0) {    Console.WriteLine("Zero"); } else {    Console.WriteLine("Positive Number!"); }The following is the complete code:Exampleusing System; using System.Collections.Generic; public class Demo {    public static void Main(string[] args) {       int n = 19; ...

Read More

Add HTML Content to Bootstrap List Group

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 297 Views

Bootstrap list groups are added using the list-group-item class.Add HTML content to the linked list groups using the following codeExample           Bootstrap Example                                                                      Tutorials                                                            Programming                                        Tutorials on Java, C, C++, etc.                                                            Web Development                                        Tutorials on PHP, HTML5, etc.                                                            Database                                        Tutorials on DBMS, MySQL, DB2, etc.                                                                        Quiz                                                            CAT                                        Quiz for CAT students.                                             NEET             Quiz for NEET students.                    

Read More

C# Program to display temporary file names

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 284 Views

The GetTempPath() method in C# displays temporary file names −Path.GetTempPath();Get the names in a variable and display −string tempFile = Path.GetTempPath();The following is the code −Exampleusing System; using System.IO; class Demo {    static void Main() {       string tempFile = Path.GetTempPath();       Console.WriteLine(tempFile);    } }Output/tmp/

Read More

C# program to count upper and lower case characters in a given string

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 1K+ Views

To count uppercase characters in a string, check the following condition −myStr[i]>='A' && myStr[i]='a' && myStr[i]

Read More

C# program to replace all spaces in a string with '%20'

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 3K+ Views

We have a sample string with spaces −str ="Hello World !";Use the Replace() method in C# to replace all spaces in a string with ‘%20’ −str2 = str.Replace(" ", "%20");ExampleYou can try to run the following code to replace all spaces in a string with ‘%20’.using System; class Demo {    static void Main() {       String str, str2;       str ="Hello World !";       Console.WriteLine("String: "+str);       str2 = str.Replace(" ", "%20");       Console.WriteLine("String (After replacing): "+str2);    } }OutputString: Hello World ! String (After replacing): Hello%20World%20!

Read More

Set the width of an element to 25% in Bootstrap

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 636 Views

To set the width of an element to 25%, use the .w-25 class in Bootstrap.You can try to run the following code to set element’s widthExample           Bootstrap Example                                          Set element width          Normal width          Width is 50%          Width is 25%          

Read More

C# Program to Illustrate Lower Triangular Matrix

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 310 Views

For the lower triangular matrix, set all the elements above the main diagonal to zero.Set the following condition −if (i >= j)    Console.Write(A[i, j] + "\t"); else    Console.Write("0\t");ExampleYou can try to run the following code to display a lower triangular matrix.using System; using System.Linq; class Demo {    static void Main() {       int m, n, i, j;       Console.Write("Enter number of rows and columns of the matrix ");       m = Convert.ToInt16(Console.ReadLine());       n = Convert.ToInt16(Console.ReadLine());       int[, ] A = new int[10, 10];       ...

Read More

C# Program to Kill a Thread

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 1K+ Views

Create a thread first and start it −// new thread Thread thread = new Thread(c.display); thread.Start();Now display the thread and set a stop function to stop the working of the thread −public void display() {    while (!flag) {       Console.WriteLine("It's Working");       Thread.Sleep(2000);    } } public void Stop() {    flag = true;    } }ExampleThe following is the complete code to learn how to kill a thread in C#.using System; using System.Threading.Tasks; using System.Threading; class Demo {        static void Main(string[] args){       MyClass c = new MyClass();   ...

Read More

Set the width of an element to 100% in Bootstrap

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 3K+ Views

To set the width of an element to 100%, use the .w-100 class in Bootstrap.You can try to run the following code to set element’s widthExample           Bootstrap Example                                          Set element width          Normal width          Width is 25%          

Read More
Showing 551–560 of 1,421 articles
« Prev 1 54 55 56 57 58 143 Next »
Advertisements