Home » .Net » C# programs

C# basic programs

This section contains C# basic programs/examples with the output and explanation. These all implemented programs are written, compiled in the Visual studio. These programs are based on the simple printing messages, mathematical problems, date & time formats etc.

List of C# basic programs

Here is the list of some of the basic C# programs...

Basics

  1. C# program to print messages/text (program to print Hello world)
  2. C# program to demonstrate example of Console.Write() and Console.WriteLine()
  3. C# program to print a new line
  4. C# program to print backslash (\)
  5. C# program to print size of various data types
  6. C# program for type conversion from double to int
  7. C# program to convert various data type to string using ToString() method
  8. C# program to define various types of constants
  9. C# program to declare different types of variables, assign the values and print
  10. C# program to input and print an integer number
  11. C# program to demonstrate example of arithmetic operators
  12. C# program to demonstrate example of assignment operators
  13. C# program to demonstrate example of sizeof() operator
  14. C# program to demonstrate example of equal to and not equal to operators
  15. C# program to demonstrate example of relational operators
  16. C# program to demonstrate example of bitwise operators
  17. C# program to find the addition of two integer numbers
  18. C# program to swap two numbers with and without using third variable
  19. C# | print type, max and min value of various data types
  20. C# program to swap numbers using XOR operator

If else (conditional statement) programs

  1. C# program to demonstrate example of simple if else statement
  2. C# program to demonstrate example of multiple if else statement
  3. C# program to demonstrate example of nested if else statement
  4. C# program to demonstrate example of conditional operator
  5. C# program to demonstrate example of nested conditional operator
  6. C# program to demonstrate example of switch statement
  7. C# program to demonstrate example of nested switch statement
  8. C# program to read two numbers and find maximum, minimum number
  9. C# program to find largest of two numbers
  10. C# program to find largest of three numbers
  11. C# program for character comparison
  12. C# program to check given strings are equal or not using equal to (==) operator
  13. C# program to input weekday number and print the weekday
  14. C# program to design a simple calculator using if else if statements
  15. C# program to design a simple calculator using switch case statement
  16. Using string with switch case statement in C#


Looping programs

  1. C# program to print numbers from 1 to 15 using while loop
  2. C# | Print numbers from 1 to 15 using do while loop
  3. C# program to find out the prime numbers among 2 to 30
  4. C# program to find out the leap years from 1900 to 1950
  5. C# program to print Even and Odd numbers from 1 to 30
  6. Define Armstrong numbers and write program to check given number is Armstrong or not, in C#
  7. C# program to check whether a given number is Palindrome or not
  8. Define Fibonacci series - Write a program to print fibonacci series in c#
  9. C# program to find sum of all digits of a given number
  10. C# program to reverse digits of a given number

C# array programs

  1. C# | different types of one dimensional array declarations
  2. C# | printing an integer array using foreach loop
  3. C# | different types of two dimensional array declarations
  4. C# | Two dimensional array with fixed row size and variable columns size
  5. Find positive numbers from array of integers using C# program
  6. Find negative numbers from array of integers using C# program
  7. Find leap years form array of integers using C# program
  8. Print all Even numbers from array of integers using C# program
  9. Print all Odd numbers from array of integers using C# program
  10. Find largest element from an integer array in C#
  11. Find smallest element from integer array in C#
  12. Find palindrome numbers from array using C# program
  13. Insert an element at given position into array using C# program
  14. Delete an element from given position from array using C# program
  15. Reverse array elements using c# program
  16. Delete given element from array using C# program
  17. Find total number of occurrence of a given number using C# program
  18. Merge two arrays into third array using C# program
  19. C# program to make a simple ATM machine

C# Character Arrays programs

  1. What is character array in C#, explain with an example?
  2. How to convert a string into character array in C#.Net?
  3. How to copy specified number of characters from a string into character array in C#?
  4. How to check whether string contains substring or not in C#?


C# String programs

  1. Comparing two strings in C#
  2. Compare strings using Equals() method in c#
  3. Demonstrate the example of Copy method of String class in C#
  4. Demonstrate the example of IndexOf() method of string class in C#
  5. Explain LastIndexOf() method of String class with Example in C#
  6. Explain String.Split() method of String class in C# with an Example
  7. How to convert string into uppercase in C#?
  8. How to convert string into lowercase in C#?
  9. How to get substring from a string in C#?
  10. How to trim the string in C#, an example of String.Trim() method?
  11. How to trim leading spaces of string using String.TrimStart() in C#?
  12. How to trim trailing spaces of string using String.TrimEnd() in C#?
  13. How to pad string from left using String.PadLeft() in C#?
  14. How to pad string from right using String.PadRight() in C#?
  15. Check whether string ends with given substring or not using String.EndsWith() in C#?
  16. How to remove given substring from a string using String.Remove() in C#?
  17. How to replace a character with another character in a string in C#?

C# Pattern printing programs

  1. C# program to print pattern of 0's and 1's

C# StreamReader/StreamWriter programs

  1. Explain StreamReader in C# with Example

Class, Object, Methods

  1. C# program to demonstrate the class and object creation
  2. 'this' reference in C#.Net with Example
  3. Explain Cascaded Method call in C# with an Example
  4. C# program for Default Arguments
  5. How to call non-trailing arguments as default argument in C#?
  6. How to pass object as argument into method in C#?
  7. Method returning object in C#





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.