karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 43 of 143

How to define a single-dimensional array in C Sharp?

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

An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type stored at contiguous memory locations.To define a single-dimensional array −int[] runs = new int[10];Let us now initialize the array in the same line −int[] runs = new int[5] {125, 173, 190, 264, 188};The following is an example displaying how to declare, initialize and display an array −Exampleusing System; namespace Program {    class Demo {       static void Main(string[] args) {          int[] runs ...

Read More

Get Bootstrap Jumbotron of full width and without rounded corners

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

To get a jumbotron of full width, and without rounded corners use the .jumbotron class outside all .container classes and instead add a .container within.ExampleYou can try to run the following code to implement this           Bootstrap Example                                                       Welcome to landing page!             Example for jumbotron.                                               Click for more                                                

Read More

How to use sizeof() operator to find the size of a data type or a variable in C#

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

The sizeof() datatype returns the size of a data type. Let’s say you need to find the size of int datatype −sizeof(int);For double datatypesizeof(double);Let us see the complete example to find the size of various datatypes −Exampleusing System; namespace Demo {    class Program {       static void Main(string[] args) {          Console.WriteLine("The size of int is {0}", sizeof(int));          Console.WriteLine("The size of int is {0}", sizeof(char));          Console.WriteLine("The size of short is {0}", sizeof(short));          Console.WriteLine("The size of long is {0}", ...

Read More

What is the Capacity property of an ArrayList class in C#?

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

The capacity property in ArrayList class gets or sets the number of elements that the ArrayList can contain.Capacity is always greater than count. For capacity property −arrList.CapacityThe default capacity is 4. If 5 elements are there, then its capacity is doubled and would be 8. This goes on.You can try to run the following the code to implement Capacity property in C#. This also shows what we discussed above −Exampleusing System; using System.Collections; class Demo {    public static void Main() {       ArrayList arrList = new ArrayList();       arrList.Add(19);       arrList.Add(44);   ...

Read More

Bootstrap panel class

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

Panel components are used when you want to put your DOM component in a box. To get a basic panel, just add class .panel to the element.You can try to run the following code to implement panel class in BootstrapExample           Bootstrap Example                                                       Demo panel                    

Read More

What is the Count property of BitArray class in C#?

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

Count the number of elements in the BitArray class using the Count property.Let us first set our BitArray class −BitArray arr = new BitArray(10);Now use the Count property as shown below −Exampleusing System; using System.Collections; public class Demo {    public static void Main() {       BitArray arr = new BitArray(10);       Console.WriteLine( "Count: {0}", arr.Count );    } }OutputCount: 10

Read More

C# program to check if a Substring is present in a Given String

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

Use the contains() method in C# to check if a substring is in a given string.Let us say the string is −UnitedWithin the string, you need to find the substring “Uni”. For that, use the contains method and use it like the following code snippet −res = str1.Contains(str2);ExampleYou can try to run the following code to find a substring in a string.using System; public class Demo {    public static void Main() {       string str1 = "United", str2 = "Uni";       bool res;       res = str1.Contains(str2);       if (res)   ...

Read More

C# program to check if two matrices are identical

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

To check whether the matrices are identical or not, you need to first check whether the matrixes can be compared or not, since for comparison at least the dimensions of the two matrices should be the same.if (row1 != row2 && col1 != col2) {    Console.Write("Matrices can't be compared:"); }Now, under else condition check for whether the metrics are identical or not. We have also set a flag here −if (row1 != row2 && col1 != col2) {    Console.Write("Matrices can't be compared:"); } else {    Console.Write("Comparison of Matrices: ");    for (i = 0; i < row1; ...

Read More

C# Example for Single Inheritance

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

The following is an example of Single Inheritance in C#. In the example, the base class is Father and declared like the following code snippet −class Father {    public void Display() {       Console.WriteLine("Display");    } }Our derived class is Son and is declared below −class Son : Father {    public void DisplayOne() {       Console.WriteLine("DisplayOne");    } }ExampleThe following is the complete example to implement Single Inheritance in C#.using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MyAplication {    class Demo {       static void Main(string[] args) {     ...

Read More

How is an array declared in C#?

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

To declare an array in C#, you can use the following syntax −datatype[ ] Name_of_array;Here, datatype is used to specify the type of elements in the array.[ ] specifies the size of the array.Name_of_array specifies the name of the array.The following is an example −double[ ] balance;Let us see an example in which an array is declared and values are added to it −Exampleusing System; namespace ArrayApplication {    class MyArray {       static void Main(string[] args) {          int [ ] n = new int[10]; /* n is an array of 10 integers ...

Read More
Showing 421–430 of 1,421 articles
« Prev 1 41 42 43 44 45 143 Next »
Advertisements