karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 65 of 143

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 637 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

C# program to find the maximum of three numbers

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

Firstly, let’s set the three numbers −int num1, num2, num3; // set the value of the three numbers num1 = 10; num2 = 20; num3 = 50;Now check the first number with the second number. If num1 > num2, then check num1 with num3. If num1 is greater than num3, that would mean the largest number is num1.ExampleYou can try to run the following code to find the maximum of three numbers.using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Demo {    class MyApplication {       static void Main(string[] args) {          int num1, ...

Read More

C# Program to Create a Thread Pool

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

For a thread pool, create more than two functions and queue methods for execution.Firstly, create a method like −public void one(object o) {    for (int i = 0; i

Read More

Addition and Concatenation in Java

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

'+' operator in java can be used to add numbers and concatenate strings. Following rules should be considered.Only numbers as operands then result will be a number.Only strings as operands then result will be a concatenated string.If both numbers and strings as operands, then numbers coming before string will be treated as numbers.If both numbers and strings as operands, then numbers coming after string will be treated as a string.Above rule can be overridden using brackets().ExampleCreate a java class named Tester.Tester.javapublic class Tester {    public static void main(String args[]) {             //Scenario 1: Only ...

Read More

C# program to find the sum of digits of a number using Recursion

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

Let’s say we have set the number for which we will find the sum of digits −int val = 789; Console.WriteLine("Number:", val);The following will find the sum of digits by entering the number and checking it recursively −public int addFunc(int val) {    if (val != 0) {       return (val % 10 + addFunc(val / 10));    } else {       return 0;    } }ExampleThe following is our code to find the sum of digits of a number using Recursion in C#.using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Demo {    class ...

Read More
Showing 641–650 of 1,421 articles
« Prev 1 63 64 65 66 67 143 Next »
Advertisements