This C# program demonstrates the use of functions by defining two simple methods: SayHello and SayGoodbye. The Main method calls these functions sequentially to display a greeting ...
This C# program demonstrates the use of functions that accept parameters. The program defines two functions: SayHello and SayGoodbye. The SayHello function accepts a string paramet...
This C# program defines a function called Sum that accepts two integer parameters, adds them together, and returns the result. The Main method initializes two integer variables (x ...
This C# program defines a function called CountSpaces that accepts a string as a parameter and returns the number of spaces in that string. The Main method calls this function with...
This C# program defines a function called WriteCentered that takes a string as a parameter and writes it centered on the screen, assuming a screen width of 80 characters. The progr...
This C# program defines a function called WriteUnderlined that takes a string as a parameter and writes it centered on the screen, assuming a screen width of 80 characters. After d...
This C# program defines a function called Sum that calculates the sum of the elements in an array. The Main method initializes an array with specific integer values and then calls ...
This C# program defines a function named "Double" that accepts an integer as a parameter and returns the integer doubled. The program demonstrates how to work with simple mathemati...
In this C# program, we define a function named "Double" that calculates the double of an integer and modifies the passed argument using reference parameters. The function will be a...
In this C# program, we define a function named "Swap" that swaps the values of two integer variables. The function accepts two parameters by reference using the `ref` keyword, mean...
In this C# program, we define a function called "Power" that calculates the result of raising an integer number to the power of another positive integer. The function must use a re...
In this C# program, we define a recursive function called "Power" that calculates the result of raising an integer number to the power of another integer. This function will use re...
In this C# program, we will write a recursive function to calculate a number in the Fibonacci series. The Fibonacci series starts with the numbers 1 and 1, and each subsequent numb...
In this C# program, we will write a function called "ChangeChar" that modifies a specific character in a string. The function should take a string and an index as parameters, and r...
In this C# program, we will write a function called "IsPrime" that checks whether a given integer is prime or not. A prime number is a number that is greater than 1 and has no divi...
In this C# program, we will create a simple console application called "sum" that takes two integer numbers as command line arguments. The program will then calculate the sum of th...
In this C# program, we will create a function called "SumDigits" that receives an integer number as input and returns the sum of its digits. The function will iterate through the d...
In this C# program, we will create a recursive function to calculate the factorial of a given number. The factorial of a number is calculated by multiplying the number by each inte...
This C# program takes multiple words as input from the command line and displays them in reverse order. The program reads the input, splits the words into an array, and then revers...
This C# function prompts the user to enter an integer value within a specified range. If the user inputs a value that is outside the given minimum and maximum range, the program wi...
This C# program demonstrates an improved version of a tasks database by splitting it into different functions. It allows the user to manage a list of tasks such as adding, displayi...
This C# program demonstrates how to write a function that receives an array of real numbers as a parameter and returns the greatest value from that array. The function iterates thr...
This C# program demonstrates how to calculate the factorial of a number using an iterative approach. The factorial of a number is the product of all integers from 1 to that number....
In this C# program, we will create a function named "WriteTitle" that takes a string as input and displays it centered on the screen with a line above and below the text. The text ...
This C# program allows the user to provide a title from the command line. The program uses the previously created "WriteTitle" function to display the title in uppercase, centered ...
This C# function is designed to calculate the number of numeric digits and vowels within a given text string. The function, named "CountDV", accepts three parameters: the string to...
This C# function is designed to check if a given character is alphabetic, meaning it falls within the range of letters A to Z (both uppercase and lowercase). The function should re...
This C# function is designed to check if a given string represents an integer number. The function should return a boolean value indicating whether the string can be successfully p...
This C# program allows users to perform basic arithmetic operations such as addition, subtraction, multiplication, or division directly from the command line. The user needs to pro...
This C# program calculates basic arithmetic operations, such as sum, subtraction, multiplication, or division, based on the command line parameters provided by the user. The progra...
This C# program defines a function named "MinMaxArray" that takes an array of floating-point numbers and returns the minimum and maximum values stored in the array using reference ...
This C# program demonstrates how to reverse a string using recursion. The program takes an input string and recursively processes each character to reverse the order. The recursion...
This C# program demonstrates how to write two functions that display rectangles on the console screen. The first function, WriteRectangle, takes the width and height as parameters ...
In this C# program, the objective is to write an iterative function that checks if a given string is a palindrome (symmetric). A palindrome is a word, phrase, or sequence that read...
In this C# program, the goal is to write a recursive function that checks if a given string is a palindrome (symmetric). A palindrome is a word, phrase, or sequence that reads the ...
In this C# program, the task is to write a function named "GetMinMax" that prompts the user to enter two values: a minimum and a maximum. The program should validate the input such...
In this exercise, you are required to write two functions in C#. Both functions will calculate the product of two numbers, but the methods used will be different. The first functio...