• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/43

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

43 Cards in this Set

  • Front
  • Back

Logicall operators

Logical (Boolean) operators take Boolean values and return a Boolean result (true or false). T

AND

&&)

OR

||

exclusive OR"

(^)

&& Operator :

t is pronounced as and operator. It returns true if both or all the condition is true and return false if any of the condition is false.

|| Operator

Itis pronounced as or operator. It also returns true or false based on condition. If any one of the condition matches then it returns true but if both or all the conditions are false then it returns false.

logical negation

!

Comparison Operators:

Comparison operatorsin C# are used to compare two or more operands.

comparison operators:

greater than (>) -less than (<) -greater than or equal to (>=) -less than or equal to (<=) -equality (==) -difference (!=)

Example for increment and decrement

inta = 5; iYantb = 4; Console.WriteLine(a++ + b); // 9 Console.WriteLine(++a + b++); // 11 Console.WriteLine(a--+ b); // 12 Console.WriteLine(--a + ++b); // 11 Console.WriteLine(--a + --b); // 9

What isComputer Programming?

??

Define: Computer Programming

creatingasequenceof instructionstoenablethecomputertodosomething

Programming Phases

??

SampleC# program:

using System; class HelloCSharp {


tatic void Main(){


Console.WriteLine("Hello, C#");

using System;

Include the standard


namespace "System"

What is "C#"?

Programming language


A syntax that allow to give instructions to the


computer

C# feature

New developed language Extremely powerful Easy to learn Easy to read and understand

C#

C#isamodernobject-oriented,general-purposeprogramminglanguage,created anddevelopedbyMicrosofttogetherwiththe

Starting the Project :

start the project, we press [Ctrl+F5] .The program will start and the result will be displayed on the console, followed by the "Press any key to continue...

First C# Program

Before we continue with an in depth description of the C# language and the , let’s take a look at a simple example, how a program written in C# looks like: class HelloCSharp { static void Main(string[] args) { Console.WriteLine("Hello C#!"); }

firstprogramconsistsofthreelogicalparts:

DefinitionofaclassHelloCSharp; -DefinitionofamethodMain(); -ContentsofthemethodMain().

(Comma)

,

Dot

.

BlankSpace

.

Semicolon

;

Double Conations)

""

Colon

:

C#DistinguishesbetweenUppercaseandLowercase:

ForexamplebagisdifferentfromBagwhichis differentfromBAG.

Identifiers:

Anidentifierisanamegiventosomeprogramentity,such asvariable,constant,array,function,structure,orclass

Data types

are sets (ranges) of values that have similar characteristics. For instance byte type specifies the set of integers in the range of [0 ... 255].

Characteristics :

Data types are characterized by: -Name –for example, int; -Size (how much memory they use) –for example, 4 bytes;

byte

8bit

short

16

int

32

long

64

char

16

float

32

double

64

decimal

128

Bool

________

Integer types

represent integer numbers is intand long. Let’s examine them one by one.

Int64.MinValue

-9,223,372,036,854,775,808 and its

MaxValue

9,223,372,036,854, 775,807 ).