SlideShare a Scribd company logo
C # (C Sharp)
Programming Language
History of C#
• Developed by Microsoft in 2000
• Anders Hejlsberg (Danish)
• Uses .cs Extension
• C# was developed by Anders Hejlsberg and
his team during the development of .Net
Framework.
.NET
• .NET is a free, cross-platform,
open source developer platform for
building many different types of
applications.
• With .NET, you can use multiple
languages, editors, and libraries to
build for web, mobile, desktop,
games, and IoT
Automatic Memory Management-
One of the biggest advantage of .net
framework is the built in memory
management.
.NET
CLR (Common Language Runtime)
Class library
..
• CLR – CLR is the foundation of the .NET Framework. It
manages code at execution time, providing core services such
as memory management, code accuracy, and many other
aspects of your code.
• Class Library- It’s collection of classes , interfaces and value
types that enable you to accomplish a range of common
programming tasks such as data collection , file access and
working with text.
What is C#
• C# is a simple, modern, object-oriented, and type-safe
programming language.
• Type safety means that the compiler will validate types while
compiling, and throw an error if you try to assign the wrong type
to a variable.
Program Structure
using System;//use to include system namespace
namespace HellWorldApplication{ // namespace declaration is a collection of classes
class HelloWorld{ //class declaration
static void Main(string[] args){
Console.WriteLine("Hello World");
Console.ReadKey();//for vs.net users. Wait till user presses key.
}
}
}
Unlike Java, program file name could be different from the class
name.
Data Types
• int (16 bit, 32 bit(default), 64 bit)
• float
• char
• double
• bool
• string
int x= 42;
double pi= 3.14;
char y = 'z';
bool isOnline= false;
string name= "David";
User Input and Output
Input
static void Main(string[] args){
string yourName;
Console.WriteLine("What is your Name?");
yourName = Console.ReadLine();
Console.WriteLine("Hello {0}", yourName);
}
//Console.ReadLine() method returns a
string value.
If you are expecting another type of value
, the entered data must be converted to
that type.
This can be done using the Convert.ToXXX
methods. Ex-
Convert.ToInt64(Console.ReadLine());
var Keyword ( implicitly typed variables)
• A variable can be explicitly declared with its type before it’s
used.
• It’s handy function to enable the compiler to determine the type
of the variable automatically based on the expression it is
assigned to.
• Ex- var num= 15; // declared integer automatically
Constant
• Constant store value that cannot be changed from their initial
assignment. To declare a constant , use the const modifier.
• Example- const double pi = 3.14;

More Related Content

What's hot

Android resource
Android resourceAndroid resource
Android resource
Krazy Koder
 

What's hot (20)

Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Android resource
Android resourceAndroid resource
Android resource
 
Android™組込み開発基礎コース BeagleBoard編
Android™組込み開発基礎コース BeagleBoard編Android™組込み開発基礎コース BeagleBoard編
Android™組込み開発基礎コース BeagleBoard編
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
C#のキモイ高速プログラミング
C#のキモイ高速プログラミングC#のキモイ高速プログラミング
C#のキモイ高速プログラミング
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Android Camera Architecture
Android Camera ArchitectureAndroid Camera Architecture
Android Camera Architecture
 
基礎から学ぶ組み込みAndroid
基礎から学ぶ組み込みAndroid基礎から学ぶ組み込みAndroid
基礎から学ぶ組み込みAndroid
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
GCC compiler
GCC compilerGCC compiler
GCC compiler
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
Deep C
Deep CDeep C
Deep C
 
C language
C languageC language
C language
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
C c#
C c#C c#
C c#
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Androidの新ビルドシステム
Androidの新ビルドシステムAndroidの新ビルドシステム
Androidの新ビルドシステム
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 

Similar to C # (C Sharp).pptx

Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
Esha Yadav
 

Similar to C # (C Sharp).pptx (20)

Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
 
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
 
introduction to c #
introduction to c #introduction to c #
introduction to c #
 
C#ppt
C#pptC#ppt
C#ppt
 
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
 
Intro.net
Intro.netIntro.net
Intro.net
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
 
OpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel ComputingOpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel Computing
 
JAVA INETRNSHIP1 made with simple topics.ppt.pptx
JAVA INETRNSHIP1 made with simple topics.ppt.pptxJAVA INETRNSHIP1 made with simple topics.ppt.pptx
JAVA INETRNSHIP1 made with simple topics.ppt.pptx
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
David buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharpDavid buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharp
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
 
OOP-Chap2.docx
OOP-Chap2.docxOOP-Chap2.docx
OOP-Chap2.docx
 
E sampark with c#.net
E sampark with c#.netE sampark with c#.net
E sampark with c#.net
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
Dotnet1
Dotnet1Dotnet1
Dotnet1
 
NDK Primer (Wearable DevCon 2014)
NDK Primer (Wearable DevCon 2014)NDK Primer (Wearable DevCon 2014)
NDK Primer (Wearable DevCon 2014)
 
C++primer
C++primerC++primer
C++primer
 
Introduction to programming using c
Introduction to programming using cIntroduction to programming using c
Introduction to programming using c
 
Introduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutionsIntroduction to .net FrameWork by QuontraSolutions
Introduction to .net FrameWork by QuontraSolutions
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 

C # (C Sharp).pptx

  • 1. C # (C Sharp) Programming Language
  • 2. History of C# • Developed by Microsoft in 2000 • Anders Hejlsberg (Danish) • Uses .cs Extension • C# was developed by Anders Hejlsberg and his team during the development of .Net Framework.
  • 3. .NET • .NET is a free, cross-platform, open source developer platform for building many different types of applications. • With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, and IoT Automatic Memory Management- One of the biggest advantage of .net framework is the built in memory management. .NET CLR (Common Language Runtime) Class library
  • 4. .. • CLR – CLR is the foundation of the .NET Framework. It manages code at execution time, providing core services such as memory management, code accuracy, and many other aspects of your code. • Class Library- It’s collection of classes , interfaces and value types that enable you to accomplish a range of common programming tasks such as data collection , file access and working with text.
  • 5. What is C# • C# is a simple, modern, object-oriented, and type-safe programming language. • Type safety means that the compiler will validate types while compiling, and throw an error if you try to assign the wrong type to a variable.
  • 6. Program Structure using System;//use to include system namespace namespace HellWorldApplication{ // namespace declaration is a collection of classes class HelloWorld{ //class declaration static void Main(string[] args){ Console.WriteLine("Hello World"); Console.ReadKey();//for vs.net users. Wait till user presses key. } } } Unlike Java, program file name could be different from the class name.
  • 7. Data Types • int (16 bit, 32 bit(default), 64 bit) • float • char • double • bool • string int x= 42; double pi= 3.14; char y = 'z'; bool isOnline= false; string name= "David";
  • 8. User Input and Output Input static void Main(string[] args){ string yourName; Console.WriteLine("What is your Name?"); yourName = Console.ReadLine(); Console.WriteLine("Hello {0}", yourName); } //Console.ReadLine() method returns a string value. If you are expecting another type of value , the entered data must be converted to that type. This can be done using the Convert.ToXXX methods. Ex- Convert.ToInt64(Console.ReadLine());
  • 9. var Keyword ( implicitly typed variables) • A variable can be explicitly declared with its type before it’s used. • It’s handy function to enable the compiler to determine the type of the variable automatically based on the expression it is assigned to. • Ex- var num= 15; // declared integer automatically
  • 10. Constant • Constant store value that cannot be changed from their initial assignment. To declare a constant , use the const modifier. • Example- const double pi = 3.14;