Giter Site home page Giter Site logo

ceyhunaslan / csharp_fundamentals Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 51 KB

I used c# embedded method-function in this project. I am happy to share this with you.

C# 100.00%
foreach-loop while-loop do-while-loop for-loop if-else if-ifelse-else switch-case try-catch methods functions

csharp_fundamentals's Introduction

CSharp_Fundamentals

I used c# embedded method-function in this project. I am happy to share this with you.

İf-Else

C# provides many decision-making statements that help the flow of the C# program based on certain logical conditions. Here, you will learn about if, else if, else, and nested if else statements to control the flow based on the conditions.

Switch-Case

In C#, Switch statement is a multiway branch statement. It provides an efficient way to transfer the execution to different parts of a code based on the value of the expression. The switch expression is of integer type such as int, char, byte, or short, or of an enumeration type, or of string type. The expression is checked for different cases and the one match is executed.

For - Loop

In c#, for loop is useful to execute a statement or a group of statements repeatedly until the defined condition returns true. Generally, for loop is useful in c# applications to iterate and execute a certain block of statements repeatedly until the specified number of times.

While - Loop

In c#, While loop is used to execute a block of statements until the specified expression return as true.

Do-While - Loop

In c#, the Do-While loop is used to execute a block of statements until the specified expression return as true. Generally, in c# the do-while loop is same as the while loop, but only the difference is while loop will execute the statements only when the defined condition returns true, but the do-while loop will execute the statements at least once because first it will execute the block of statements and then it will checks the condition.

Foreach - Loop

In c#, the Foreach loop is useful to loop through each item in an array or collection object to execute the block of statements repeatedly. Generally, in c# Foreach loop will work with the collection objects such as an array, list, etc., to execute the block of statements for each element in the array or collection. After completing iterating through each element in the collection, control will be transferred to the next statement following the foreach block. In c#, we can use a break, continue, goto and return statements within the foreach loop to exit or continue to the next iteration of the loop based on our requirements. # Try- Catch In c#, the try-catch statement is useful to handle unexpected or runtime exceptions that will occur during the program's execution. The try-catch statement will contain a try block followed by one or more catch blocks to handle different exceptions.

Functions

Using functions in C# allows you to repeatedly run the code block you have created anywhere in the program. The function you created can be used both in the project and out of the project, one or more times, privately or openly. In this way, we will not repeat the same codes by using a function, and we will alleviate our work by correcting it in one place when it needs to be corrected. You can look at the sample special function I made.

Methods

In c#, Method is a separate code block, and that contains a series of statements to perform particular operations. Methods must be declared either in class or struct by specifying the required parameters.

Cinema Ticket My Project

#Sing In - Sing Up My Project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.