karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 54 of 143

C# Program to Convert Character case

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

Let’s say your string is −str = "AMIT";To convert the above uppercase string in lowercase, use the ToLower() method −Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());ExampleThe following is the code in C# to convert character case.using System; using System.Collections.Generic; using System.Text; namespace Demo {    class MyApplication {       static void Main(string[] args) {          string str;          str = "AMIT";          Console.WriteLine("UpperCase : {0}", str);          // convert to lowercase          Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());          Console.ReadLine();       }    } }OutputUpperCase : AMIT Converted to LowerCase : amit

Read More

Get the creation time of a file in C#

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

To get the creation time of a file in C#, use the CreationTime() method.For this, use the FileInfo as well as DateTime classes.Create an object of each −FileInfo file = new FileInfo("new.txt"); DateTime dt = file.CreationTime;Let us see the complete code −Exampleusing System.IO; using System; public class Program {    public static void Main() {       using (StreamWriter sw = new StreamWriter("qa.txt")) {          sw.WriteLine("Questions and Answers!");       }       FileInfo file = new FileInfo("qa.txt");       // file creation time       DateTime dt = file.CreationTime;       Console.WriteLine(dt);    } }Output9/5/2018 5:20:03 AM

Read More

Literal number suffixes in C#

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

To specify number types, use suffixes in C#. Literal number suffixes are numeric suffixes.For example, for long type −// long suffix long val1 = 29345L;For double type −// double suffix double val2 = 297.325D; Console.WriteLine(val2);Let us see more examples −Exampleusing System.IO; using System; public class Program {    public static void Main() {       // long suffix       long val1 = 29345L;       Console.WriteLine(val1);       // decimal suffix       decimal val5 = 3245.5678M;       Console.WriteLine(val5);       // double suffix       double val2 = 297.325D;       Console.WriteLine(val2);       // float suffix       float val3 = 250.35F;       Console.WriteLine(val3);       // unsigned suffix       uint val4 = 3456U;       Console.WriteLine(val4);    } }Output29345 3245.5678 297.325 250.35 3456

Read More

C# Program to convert first character uppercase in a sentence

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

Let us say the following is your string −String str = "Welcome to our website!";Create a char array of the string included above using the ToCharArray() method:char []ch = str.ToCharArray();To convert the first character to uppercase −if (ch[i] >= 'a' && ch[i] = 'a' && val[i] = 'A' && val[i]

Read More

How to call a method of a class in C#

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

To call a method, use the name of the method after the object name, for example, −obj1. Display();Let’s say the class name is ApplicationOne, so to call the method −ApplicationOne one = new ApplicationOne(); //calling the displayMax method ret = one.displayMax(a, b);The following is the example showing how to call a method in C# −Exampleusing System; namespace Demp {    class ApplicationOne {       public int displayMax(int num1, int num2) {          /* local variable declaration */          int result;          if (num1 > num2)   ...

Read More

Random Numbers in C#

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

To generate random numbers in C#, use the Next(minValue, MaxValue) method. The parameters are used to set the minimum and maximum values.Next(100,200);We have set the above method under Random() object.Random rd = new Random(); int rand_num = rd.Next(100,200);The following is an example −Exampleusing System; class Program {    static void Main() {       Random rd = new Random();       int rand_num = rd.Next(100,200);       Console.WriteLine(rand_num);    } }Output182

Read More

Create a tabbed menu with Bootstrap

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

To create a tabbed menu with Bootstrap, you can try to run the following codeExample           Bootstrap Example                                          Database          The following are the database technologies:                       DB2             MySQL             SQL             CouchDB                    

Read More

How to generate the first 100 even Numbers using C#?

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

To generate first 100 even numbers, set a for loop from 1 to 100.for(val = 1; val

Read More

Bootstrap Accordion

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

To create an Accordion in Bootstrap, you can try to run the following codeExample           Bootstrap Example                                          My Website                                                                              Tutorials                                                                     We provide tutorials on C, C++, Java, PHP, Networking, SEO, C++, C, etc.                                                                                                Quiz                                                                     We provide quizzes on C, C++, Java, PHP, Ruby, DBMS, Networking, SEO, etc.                                                

Read More

What are dynamic arrays in C#?

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

Dynamic arrays are growable arrays and have an advantage over static arrays. This is because the size of an array is fixed.To create arrays dynamically in C#, use the ArrayList collection. It represents an ordered collection of an object that can be indexed individually. It also allows dynamic memory allocation, adding, searching and sorting items in the list.The following is an example showing how to create arrays dynamically in C# −Exampleusing System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          ArrayList al = new ArrayList(); ...

Read More
Showing 531–540 of 1,421 articles
« Prev 1 52 53 54 55 56 143 Next »
Advertisements