Csharp Articles

Page 83 of 196

Medium-Earth Orbit Satellites

Samual Sam
Samual Sam
Updated on 17-Mar-2026 2K+ Views

This article appears to be about satellite orbits, not C# programming. As a C# tutorial enhancement specialist, I can only improve C# programming articles for TutorialsPoint.com. Please provide a C# programming article that needs improvement, such as topics related to: C# language features (classes, methods, properties, etc.) .NET Framework concepts Object-oriented programming in C# C# syntax and programming constructs C# libraries and APIs I'll be happy to enhance any C# programming tutorial following the TutorialsPoint standards with proper code formatting, examples, and structure.

Read More

C# program to check password validity

Samual Sam
Samual Sam
Updated on 17-Mar-2026 985 Views

While creating a password, you may have seen validation requirements on websites that ensure a password is strong and secure. Common password requirements include − Minimum 8 characters and maximum 14 characters At least one lowercase letter No whitespace characters At least one uppercase letter At least one special character Let us create a complete password validation program that checks all these conditions systematically. Complete Password Validation Program using System; using System.Linq; class PasswordValidator { public static bool IsValidPassword(string passwd) { ...

Read More

C# Program to Check Whether the Entered Number is an Armstrong Number or Not

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

An Armstrong number (also called a narcissistic number) is a number that equals the sum of its digits raised to the power of the number of digits. For a 3-digit number, each digit is cubed and summed. For example, 153 is an Armstrong number because − 1³ + 5³ + 3³ = 1 + 125 + 27 = 153 Armstrong Number Check Process 153 Original Number 1³ + 5³ + 3³ Sum of Cubes ...

Read More

C# program to convert a list of characters into a string

Samual Sam
Samual Sam
Updated on 17-Mar-2026 1K+ Views

Converting a list of characters into a string is a common operation in C#. There are several approaches to accomplish this task, each suitable for different scenarios and data structures. Syntax Following are the main syntax patterns for converting characters to strings − // Using string constructor with char array string result = new string(charArray); // Using string.Join() method string result = string.Join("", charList); // Using StringBuilder class StringBuilder sb = new StringBuilder(); sb.Append(charArray); string result = sb.ToString(); Using String Constructor with Character Array The most direct approach is using the ...

Read More

C# program to iterate over a string array with for loop

Chandu yadav
Chandu yadav
Updated on 17-Mar-2026 3K+ Views

A string array in C# can be iterated using a for loop to access each element by its index. The loop runs from index 0 to the length of the array minus one, allowing you to process each string element sequentially. Syntax Following is the syntax for iterating over a string array with a for loop − for (int i = 0; i < arrayName.Length; i++) { // Access element: arrayName[i] } The Length property returns the total number of elements in the array, and the loop variable i serves ...

Read More

C# program to count the number of words in a string

karthikeya Boyini
karthikeya Boyini
Updated on 17-Mar-2026 8K+ Views

In C#, counting the number of words in a string can be accomplished using various approaches. The most common method involves iterating through each character and identifying word separators like spaces, tabs, and newlines. Using Character-by-Character Iteration This approach loops through the string and counts whitespace characters to determine word boundaries − using System; public class Demo { public static void Main() { int a = 0, myWord = 1; string str = "Hello World!"; if (str.Length == 0) { myWord = 0; } else { while (a

Read More

C# program to display the previous day

George John
George John
Updated on 17-Mar-2026 4K+ Views

To display the previous day in C#, use the AddDays() method with a value of -1. This method allows you to add or subtract days from a DateTime object. Syntax Following is the syntax for getting the current date − DateTime.Today Following is the syntax for getting the previous day using AddDays() − DateTime.Today.AddDays(-1) Using DateTime.Today.AddDays(-1) The DateTime.Today property returns the current date with the time set to midnight. The AddDays(-1) method subtracts one day from this date − using System; public class Demo { ...

Read More

C# program to count occurrences of a word in string

Samual Sam
Samual Sam
Updated on 17-Mar-2026 4K+ Views

Counting occurrences of a specific word in a string is a common string manipulation task in C#. This can be achieved using various approaches like the IndexOf() method, regular expressions, or LINQ methods. Using IndexOf() Method The IndexOf() method searches for the first occurrence of a substring and returns its position. By combining it with a loop, we can count all occurrences − using System; class Program { static void Main() { string str = "Hello World! Hello Universe! Hello!"; ...

Read More

C# program to convert binary string to Integer

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

Converting a binary string to an integer in C# can be accomplished using several methods. The most straightforward approach is using Convert.ToInt32() with base 2, but you can also implement manual conversion for better understanding of the binary-to-decimal process. Using Convert.ToInt32() Method The simplest way to convert a binary string to an integer is using the built-in Convert.ToInt32() method with base 2 − using System; class Program { static void Main() { string binaryStr = "1001"; ...

Read More

C# Program to find the largest element from an array

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

Finding the largest element in an array is a common programming task in C#. There are multiple approaches to achieve this, ranging from using built-in LINQ methods to implementing custom logic with loops. Using LINQ Max() Method The simplest approach is to use the Max() method from the System.Linq namespace − using System; using System.Linq; class Demo { static void Main() { int[] arr = { 20, 50, -35, 25, 60 }; int largest = ...

Read More
Showing 821–830 of 1,951 articles
« Prev 1 81 82 83 84 85 196 Next »
Advertisements