Tuesday, 15 March 2016

Basics of C#

Basics of C#
The following reasons make C# a widely used professional language:
  • It is a modern, general-purpose programming language
  • It is object oriented.
  • It is component oriented.
  • It is easy to learn.
  • It is a structured language.
  • It produces efficient programs.
  • It can be compiled on a variety of computer platforms.
  • It is a part of .Net Framework.
Decision making statements
if statement
An if statement consists of a boolean expression followed by one or more statements.

if..else statement
An if statement can be followed by an optional else statement, which executes when the boolean expression is false.

Loops
While
while loop statement in C# repeatedly executes a target statement as long as a given condition is true.

do...while
do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time.

for loop
for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.

String manipulations
Concatenation
Strings can be concatenated (joined) by using the + operator.

index of
we use the IndexOf method to find where in a string a particular character.

Substring method
By using this method we can get a certain from a given paragraph.









No comments:

Post a Comment

: