SlideShare a Scribd company logo
C# and F# Programming Language
C SHARP It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270).  C# is one of the programming languages designed for the Common Language Infrastructure. "C sharp" was inspired by musical notation where a sharp indicates that the written note should be made a semitone higher in pitch. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg, who was previously involved with the design of Turbo Pascal, Embarcadero Delphi.
Design Goals of C# C# language is intended to be a simple, modern, general-purpose, object-oriented programming language. The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables, and automatic garbage collection. The language is intended for use in developing software components suitable for deployment in distributed environments. Source code portability is very important, as is programmer portability, especially for those programmers already familiar with C and C++.
Design Goals of C# Support for internationalization is very important. C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions. Although C# applications are intended to be economical with regard to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.
Versions of C#
Distinguishing Features of C# It has no global variables or functions. All methods and members must be declared within classes. Static members of public classes can substitute for global variables and functions. Local variables cannot shadow variables of the enclosing block, unlike C and C++. Variable shadowing is often considered confusing by C++ texts. C# supports a strict Boolean data type. In C#, memory address pointers can only be used within blocks specifically marked as unsafe, and programs with unsafe code need appropriate permissions to run.  Managed memory cannot be explicitly freed.
Distinguishing Features of C# Multiple inheritance is not supported, although a class can implement any number of interfaces. C# is more type safe than C++.  C# currently (as of version 4.0) has 77 reserved words.
Categories of data types Value types ,[object Object]
Examples of value types are all primitive types, such as int (a signed 32-bit integer), float (a 32-bit IEEE floating-point number), char (a 16-bit Unicode code unit), and System.DateTime (identifies a specific point in time with nanosecond precision).,[object Object]
Examples of reference types are object (the ultimate base class for all other C# classes), System.String (a string of Unicode characters), and System.Array (a base class for all C# arrays).,[object Object]
Preprocessor C# features "preprocessor directives" (though it does not have an actual preprocessor) based on the C preprocessor that allow programmers to define symbols but not macros. Conditionals such as #if, #endif, and #else are also provided. Directives such as #region give hints to editors for code folding. public class Foo { #region Procedures     public void IntBar(intfirstParam) {}     public void StrBar(string firstParam) {}     public void BoolBar(bool firstParam) {}     #endregion     #region Constructors     public Foo() {}     public Foo(intfirstParam) {}     #endregion }
"Hello world" example using System; class Program {     static void Main()     { Console.WriteLine("Hello world!");     } }
using System; ,[object Object],class Program ,[object Object],static void Main() ,[object Object],Console.WriteLine("Hello world!"); ,[object Object],[object Object]
Simple/primitive types
Advanced numeric types
Lifted (nullable) types
Special feature keywords
Special feature keywords
C Sharp Identifier An identifier can: ,[object Object]
contain both upper case and lower case Unicode letters. Case is significant.An identifier cannot: ,[object Object]
start with a symbol, unless it is a keyword (check Keywords).
have more than 511 chars.,[object Object]
C Sharp Literals
C Sharp Literals
 Variables Variables are identifiers associated with values. They are declared by writing the variable's type and name, and are optionally initialized in the same statement by assigning a value. Declare intMyInt;         // Declaring an uninitialized variable called 'MyInt', of type 'int' Initialize intMyInt;        // Declaring an uninitialized variable MyInt = 35;       // Initializing the variable Declare & initialize intMyInt = 35;   // Declaring and initializing the variable at the same time
 Operators
Conditional structures if statement ,[object Object],Simple one-line statement: if (i == 3) ... ; Multi-line with else-block (without any braces): if (i == 2)     ... else     ...
Conditional structures switch statement ,[object Object],switch (ch) { case 'A':         ...         break;     case 'B':     case 'C':          ...          break;     default:         ...         break; }
Jump statements The goto statement can be used in switch statements to jump from one case to another or to fall through from one case to the next. switch(n) {     case 1: Console.WriteLine("Case 1");         break;     case 2: Console.WriteLine("Case 2"); goto case 1;     case 3: Console.WriteLine("Case 3");     case 4: // Compilation will fail here as cases cannot fall through in C#. Console.WriteLine("Case 4"); goto default; // This is the correct way to fall through to the next case.     default: Console.WriteLine("Default"); }
Iteration structures while loop while (i == true) {     ... } do ... while loop do {     ... } while (i == true); for loop ,[object Object],for (int i = 0; i < 10; i++) {     ... }
break statement The break statement breaks out of the closest loop or switch statement. Execution continues in the statement after the terminated statement, if any. int e = 10; for (int i=0; i < e; i++) {     while (true)     {         break;     }     // Will break to this point. }
continue statement The continue statement discontinues the current iteration of the current control statement and begins the next iteration. intch; while ((ch = GetChar()) >= 0) {     if (ch == ' ')         continue;    // Skips the rest of the while-loop     // Rest of the while-loop     ... }
Modifiers Modifiers are keywords used to modify declarations of types and type members. Most notably there is a sub-group containing the access modifiers. ,[object Object]
const - Specifies that a variable is a constant value that has to be initialized when it gets declared.
event - Declare an event.
extern - Specify that a method signature without a body uses a DLL-import.
override - Specify that a method or property declaration is an override of a virtual member or an implementation of a member of an abstract class.
readonly - Declare a field that can only be assigned values as part of the declaration or in a constructor in the same class.
sealed - Specifies that a class cannot be inherited.
static - Specifies that a member belongs to the class and not to a specific instance. (see section static)
unsafe - Specifies an unsafe context, which allows the use of pointers.
virtual - Specifies that a method or property declaration can be overridden by a derived class.
volatile - Specifies a field which may be modified by an external process and prevents an optimizing compiler from modifying the use of the field.,[object Object]
F SHARP F# uses pattern matching to resolve names into values. It is also used when accessing discriminated unions. F# comes with a Microsoft Visual Studio language service that integrates it with the IDE. All functions in F# are instances of the function type, and are immutable as well. The F# extended type system is implemented as generic .NET types.
Examples A few small samples follow: (* This is a comment *) (* Sample hello world program *) printfn "Hello World!"
 Operators
Operators
Functions

More Related Content

What's hot

Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and Answer
Vineet Kumar Saini
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
sajjad ali khan
 
New c sharp4_features_part_ii
New c sharp4_features_part_iiNew c sharp4_features_part_ii
New c sharp4_features_part_ii
Nico Ludwig
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
VigneshVijay21
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dart
Imran Qasim
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
adarshynl
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
Md. Mahedee Hasan
 
CSharp difference faqs- 1
CSharp difference faqs- 1CSharp difference faqs- 1
CSharp difference faqs- 1
Umar Ali
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
nadim akber
 
C sharp
C sharpC sharp
C sharp
sanjay joshi
 
Deep C
Deep CDeep C
Deep C
Olve Maudal
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
patricia Hidalgo
 
delphi-interfaces.pdf
delphi-interfaces.pdfdelphi-interfaces.pdf
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
Dr.Neeraj Kumar Pandey
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Leandro Schenone
 
C reference manual
C reference manualC reference manual
C reference manual
Komal Ahluwalia
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoo
birbal
 
C#unit4
C#unit4C#unit4
C#unit4
raksharao
 

What's hot (18)

Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and Answer
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
New c sharp4_features_part_ii
New c sharp4_features_part_iiNew c sharp4_features_part_ii
New c sharp4_features_part_ii
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dart
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
 
CSharp difference faqs- 1
CSharp difference faqs- 1CSharp difference faqs- 1
CSharp difference faqs- 1
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
 
C sharp
C sharpC sharp
C sharp
 
Deep C
Deep CDeep C
Deep C
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
 
delphi-interfaces.pdf
delphi-interfaces.pdfdelphi-interfaces.pdf
delphi-interfaces.pdf
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
C reference manual
C reference manualC reference manual
C reference manual
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoo
 
C#unit4
C#unit4C#unit4
C#unit4
 

Viewers also liked

Transportation
TransportationTransportation
Transportation
Harry Balois
 
Age Awareness
Age AwarenessAge Awareness
Age Awareness
Staff Management | SMX
 
c# at f#
c# at f#c# at f#
c# at f#
Harry Balois
 
Apresentação bizmeet
Apresentação bizmeetApresentação bizmeet
Apresentação bizmeet
Juliana Ribeiro
 
Disability Discrimination Month
Disability Discrimination MonthDisability Discrimination Month
Disability Discrimination Month
Staff Management | SMX
 
Celebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in OctoberCelebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in October
Staff Management | SMX
 
Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012
Vina Star Motors Corporation
 
Kham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anhKham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anh
Vina Star Motors Corporation
 
Bodas albert camus
Bodas   albert camusBodas   albert camus
Bodas albert camus
quinteroregos
 

Viewers also liked (9)

Transportation
TransportationTransportation
Transportation
 
Age Awareness
Age AwarenessAge Awareness
Age Awareness
 
c# at f#
c# at f#c# at f#
c# at f#
 
Apresentação bizmeet
Apresentação bizmeetApresentação bizmeet
Apresentação bizmeet
 
Disability Discrimination Month
Disability Discrimination MonthDisability Discrimination Month
Disability Discrimination Month
 
Celebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in OctoberCelebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in October
 
Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012
 
Kham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anhKham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anh
 
Bodas albert camus
Bodas   albert camusBodas   albert camus
Bodas albert camus
 

Similar to C# AND F#

Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
Raghuveer Guthikonda
 
fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
AzhagesvaranTamilsel
 
C++ Training
C++ TrainingC++ Training
C++ Training
SubhendraBasu5
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
MAHESHV559910
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
InfinityWorld3
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptx
PradeepKumar206701
 
1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx
tarifarmarie
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
Yashsharma304389
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
Sagar Pednekar
 
java vs C#
java vs C#java vs C#
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
sachindane
 
Final requirement
Final requirementFinal requirement
Final requirement
arjoy_dimaculangan
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
shubhra chauhan
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
Durga Padma
 
C programming notes
C programming notesC programming notes
C programming notes
Prof. Dr. K. Adisesha
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdf
ssusera0bb35
 
Introduction to c sharp
Introduction to c sharpIntroduction to c sharp
Introduction to c sharp
immamir2
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++
DevangiParekh1
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
AdiseshaK
 
Introduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh SinghIntroduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh Singh
singhadarsh
 

Similar to C# AND F# (20)

Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
 
C++ Training
C++ TrainingC++ Training
C++ Training
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptx
 
1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
 
java vs C#
java vs C#java vs C#
java vs C#
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
Final requirement
Final requirementFinal requirement
Final requirement
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
C programming notes
C programming notesC programming notes
C programming notes
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdf
 
Introduction to c sharp
Introduction to c sharpIntroduction to c sharp
Introduction to c sharp
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
 
Introduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh SinghIntroduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh Singh
 

Recently uploaded

Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Leena Ghag-Sakpal
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 

Recently uploaded (20)

Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 

C# AND F#

  • 1. C# and F# Programming Language
  • 2. C SHARP It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the programming languages designed for the Common Language Infrastructure. "C sharp" was inspired by musical notation where a sharp indicates that the written note should be made a semitone higher in pitch. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg, who was previously involved with the design of Turbo Pascal, Embarcadero Delphi.
  • 3. Design Goals of C# C# language is intended to be a simple, modern, general-purpose, object-oriented programming language. The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables, and automatic garbage collection. The language is intended for use in developing software components suitable for deployment in distributed environments. Source code portability is very important, as is programmer portability, especially for those programmers already familiar with C and C++.
  • 4. Design Goals of C# Support for internationalization is very important. C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions. Although C# applications are intended to be economical with regard to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.
  • 6. Distinguishing Features of C# It has no global variables or functions. All methods and members must be declared within classes. Static members of public classes can substitute for global variables and functions. Local variables cannot shadow variables of the enclosing block, unlike C and C++. Variable shadowing is often considered confusing by C++ texts. C# supports a strict Boolean data type. In C#, memory address pointers can only be used within blocks specifically marked as unsafe, and programs with unsafe code need appropriate permissions to run. Managed memory cannot be explicitly freed.
  • 7. Distinguishing Features of C# Multiple inheritance is not supported, although a class can implement any number of interfaces. C# is more type safe than C++. C# currently (as of version 4.0) has 77 reserved words.
  • 8.
  • 9.
  • 10.
  • 11. Preprocessor C# features "preprocessor directives" (though it does not have an actual preprocessor) based on the C preprocessor that allow programmers to define symbols but not macros. Conditionals such as #if, #endif, and #else are also provided. Directives such as #region give hints to editors for code folding. public class Foo { #region Procedures public void IntBar(intfirstParam) {} public void StrBar(string firstParam) {} public void BoolBar(bool firstParam) {} #endregion #region Constructors public Foo() {} public Foo(intfirstParam) {} #endregion }
  • 12. "Hello world" example using System; class Program { static void Main() { Console.WriteLine("Hello world!"); } }
  • 13.
  • 19.
  • 20.
  • 21. start with a symbol, unless it is a keyword (check Keywords).
  • 22.
  • 25. Variables Variables are identifiers associated with values. They are declared by writing the variable's type and name, and are optionally initialized in the same statement by assigning a value. Declare intMyInt; // Declaring an uninitialized variable called 'MyInt', of type 'int' Initialize intMyInt; // Declaring an uninitialized variable MyInt = 35; // Initializing the variable Declare & initialize intMyInt = 35; // Declaring and initializing the variable at the same time
  • 27.
  • 28.
  • 29. Jump statements The goto statement can be used in switch statements to jump from one case to another or to fall through from one case to the next. switch(n) { case 1: Console.WriteLine("Case 1"); break; case 2: Console.WriteLine("Case 2"); goto case 1; case 3: Console.WriteLine("Case 3"); case 4: // Compilation will fail here as cases cannot fall through in C#. Console.WriteLine("Case 4"); goto default; // This is the correct way to fall through to the next case. default: Console.WriteLine("Default"); }
  • 30.
  • 31. break statement The break statement breaks out of the closest loop or switch statement. Execution continues in the statement after the terminated statement, if any. int e = 10; for (int i=0; i < e; i++) { while (true) { break; } // Will break to this point. }
  • 32. continue statement The continue statement discontinues the current iteration of the current control statement and begins the next iteration. intch; while ((ch = GetChar()) >= 0) { if (ch == ' ') continue; // Skips the rest of the while-loop // Rest of the while-loop ... }
  • 33.
  • 34. const - Specifies that a variable is a constant value that has to be initialized when it gets declared.
  • 35. event - Declare an event.
  • 36. extern - Specify that a method signature without a body uses a DLL-import.
  • 37. override - Specify that a method or property declaration is an override of a virtual member or an implementation of a member of an abstract class.
  • 38. readonly - Declare a field that can only be assigned values as part of the declaration or in a constructor in the same class.
  • 39. sealed - Specifies that a class cannot be inherited.
  • 40. static - Specifies that a member belongs to the class and not to a specific instance. (see section static)
  • 41. unsafe - Specifies an unsafe context, which allows the use of pointers.
  • 42. virtual - Specifies that a method or property declaration can be overridden by a derived class.
  • 43.
  • 44. F SHARP F# uses pattern matching to resolve names into values. It is also used when accessing discriminated unions. F# comes with a Microsoft Visual Studio language service that integrates it with the IDE. All functions in F# are instances of the function type, and are immutable as well. The F# extended type system is implemented as generic .NET types.
  • 45. Examples A few small samples follow: (* This is a comment *) (* Sample hello world program *) printfn "Hello World!"
  • 51. Types
  • 58. The End Presented by: Harry Kim Balois BSCS 41A