SlideShare a Scribd company logo
C Sharp (C#)
By:
Ralph W.
Summary

Defining variables

Getting user input

Displaying user input

Finding odd or even numbers

Switch cases, looping, and logic statements

Comparing sub string within a another string

Clearing screen

Quitting Program
Defining variables

Byte – byte, 8 width, 0 -255

Signed byte – sbyte, 8 width, -127 to 127

integer – int, 32 width,
-2147483648 to 2127483647

String – string,

long, short, char, object, decimal, bool,
double, float, ulong, ushort,

ex: int value;
Getting user input

valueStr = Console.ReadLine()
Displaying user input

Console.WriteLine(valueStr);
Finding odd or even numbers

if(value % 2 != 0), odd

if(value % 2 == 0), even
Switches, loops, and logic

Switch ( caseNumber)
{ case 0: break; default: }

Do { // do something } while( condition);

While (condition) { // do something}

If (condition) { } else { }
Comparing strings

Compare String
String.Compare(str1, str2, true)
− True to ignore case during comparison,
otherwise false.
Clearing screen

Console.Clear();
Exiting Program

Normal exit
− Run a tight loop for the display
− Allow the user to select exit criteria
− Put up a warning message
− Allow the program to exit naturally

Graceful exit with exceptions
− If you want to get fancy you can catch
exceptions and exit gracefully
Extras

Structures

Classes

Linked Lists

Converting strings to integers

More Related Content

What's hot

JAVA Literals
JAVA LiteralsJAVA Literals
JAVA Literals
ASHUTOSH TRIVEDI
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NET
Shyam Sir
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Type casting
Type castingType casting
Type casting
simarsimmygrewal
 
[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes
Muhammad Hammad Waseem
 
Character set of c
Character set of cCharacter set of c
Character set of c
Chandrapriya Rediex
 
Basic of c &c++
Basic of c &c++Basic of c &c++
Basic of c &c++
guptkashish
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
teach4uin
 
Ppt lesson 08
Ppt lesson 08Ppt lesson 08
Ppt lesson 08
Linda Bodrie
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
Saad Sheikh
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operators
raksharao
 
Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in C
Arpana shree
 
arrays and pointers
arrays and pointersarrays and pointers
arrays and pointers
Samiksha Pun
 
Lecture no 1
Lecture no 1Lecture no 1
Lecture no 1
hasi071
 
Ppt lesson 07
Ppt lesson 07Ppt lesson 07
Ppt lesson 07
Linda Bodrie
 
Lect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer AbbasLect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer Abbas
Information Technology Center
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
 
Type conversion
Type conversionType conversion
Type conversion
Frijo Francis
 

What's hot (19)

JAVA Literals
JAVA LiteralsJAVA Literals
JAVA Literals
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NET
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
 
Type casting
Type castingType casting
Type casting
 
[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes[ITP - Lecture 05] Datatypes
[ITP - Lecture 05] Datatypes
 
Character set of c
Character set of cCharacter set of c
Character set of c
 
Basic of c &c++
Basic of c &c++Basic of c &c++
Basic of c &c++
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
 
Ppt lesson 08
Ppt lesson 08Ppt lesson 08
Ppt lesson 08
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operators
 
Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in C
 
arrays and pointers
arrays and pointersarrays and pointers
arrays and pointers
 
Lecture no 1
Lecture no 1Lecture no 1
Lecture no 1
 
Ppt lesson 07
Ppt lesson 07Ppt lesson 07
Ppt lesson 07
 
Lect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer AbbasLect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer Abbas
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Type conversion
Type conversionType conversion
Type conversion
 

Viewers also liked

CV Rauf
CV RaufCV Rauf
CV Rauf
Huseynov Rauf
 
Muhammad imtiaz azam. Cv
Muhammad imtiaz azam. CvMuhammad imtiaz azam. Cv
Muhammad imtiaz azam. Cv
Imtiaz Azam
 
6º módulo 1ª aula
6º módulo   1ª aula6º módulo   1ª aula
6º módulo 1ª aula
Joel Silva
 
Resume_Irshad
Resume_IrshadResume_Irshad
Resume_Irshad
Irshad Hashim
 
Water alternating gas (WAG) - A Enhanced Oil Recovery technique
Water alternating gas (WAG) - A Enhanced Oil Recovery techniqueWater alternating gas (WAG) - A Enhanced Oil Recovery technique
Water alternating gas (WAG) - A Enhanced Oil Recovery technique
Ibrahim Muhammad
 
Cellgen - Companion Diagnostic Platform
Cellgen - Companion Diagnostic PlatformCellgen - Companion Diagnostic Platform
Cellgen - Companion Diagnostic Platform
Lavance L. Northington
 
Beyond Basic VoLTE Services: Avoiding 3 Mistakes of the Past
Beyond Basic VoLTE Services: Avoiding 3 Mistakes of the PastBeyond Basic VoLTE Services: Avoiding 3 Mistakes of the Past
Beyond Basic VoLTE Services: Avoiding 3 Mistakes of the Past
Radisys Corporation
 
4º módulo 4ª aula
4º módulo   4ª aula4º módulo   4ª aula
4º módulo 4ª aula
Joel Silva
 
5º módulo 1ª aula
5º módulo   1ª aula5º módulo   1ª aula
5º módulo 1ª aula
Joel Silva
 
BCH Electric Limited- Complete Product Range Catalogue
BCH Electric Limited- Complete Product Range CatalogueBCH Electric Limited- Complete Product Range Catalogue
BCH Electric Limited- Complete Product Range Catalogue
BCH Electric Limited
 

Viewers also liked (10)

CV Rauf
CV RaufCV Rauf
CV Rauf
 
Muhammad imtiaz azam. Cv
Muhammad imtiaz azam. CvMuhammad imtiaz azam. Cv
Muhammad imtiaz azam. Cv
 
6º módulo 1ª aula
6º módulo   1ª aula6º módulo   1ª aula
6º módulo 1ª aula
 
Resume_Irshad
Resume_IrshadResume_Irshad
Resume_Irshad
 
Water alternating gas (WAG) - A Enhanced Oil Recovery technique
Water alternating gas (WAG) - A Enhanced Oil Recovery techniqueWater alternating gas (WAG) - A Enhanced Oil Recovery technique
Water alternating gas (WAG) - A Enhanced Oil Recovery technique
 
Cellgen - Companion Diagnostic Platform
Cellgen - Companion Diagnostic PlatformCellgen - Companion Diagnostic Platform
Cellgen - Companion Diagnostic Platform
 
Beyond Basic VoLTE Services: Avoiding 3 Mistakes of the Past
Beyond Basic VoLTE Services: Avoiding 3 Mistakes of the PastBeyond Basic VoLTE Services: Avoiding 3 Mistakes of the Past
Beyond Basic VoLTE Services: Avoiding 3 Mistakes of the Past
 
4º módulo 4ª aula
4º módulo   4ª aula4º módulo   4ª aula
4º módulo 4ª aula
 
5º módulo 1ª aula
5º módulo   1ª aula5º módulo   1ª aula
5º módulo 1ª aula
 
BCH Electric Limited- Complete Product Range Catalogue
BCH Electric Limited- Complete Product Range CatalogueBCH Electric Limited- Complete Product Range Catalogue
BCH Electric Limited- Complete Product Range Catalogue
 

Similar to C sharp_basic_ideas

Csharp4 operators and_casts
Csharp4 operators and_castsCsharp4 operators and_casts
Csharp4 operators and_casts
Abed Bukhari
 
C tutorial
C tutorialC tutorial
C tutorial
Anurag Sukhija
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
BAINIDA
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
Abed Bukhari
 
vb.net.pdf
vb.net.pdfvb.net.pdf
vb.net.pdf
VimalSangar1
 
Python programming unit 2 -Slides-3.ppt
Python programming  unit 2 -Slides-3.pptPython programming  unit 2 -Slides-3.ppt
Python programming unit 2 -Slides-3.ppt
geethar79
 
CSharp Language Overview Part 1
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1
Hossein Zahed
 
Bsc cs i pic u-4 function, storage class and array and strings
Bsc cs i pic u-4 function, storage class and array and stringsBsc cs i pic u-4 function, storage class and array and strings
Bsc cs i pic u-4 function, storage class and array and strings
Rai University
 
Dr. Rajeshree Khande : Programming concept of basic java
Dr. Rajeshree Khande : Programming concept of basic javaDr. Rajeshree Khande : Programming concept of basic java
Dr. Rajeshree Khande : Programming concept of basic java
jalinder123
 
Dr. Rajeshree Khande : Java Basics
Dr. Rajeshree Khande  : Java BasicsDr. Rajeshree Khande  : Java Basics
Dr. Rajeshree Khande : Java Basics
DrRajeshreeKhande
 
Btech i pic u-4 function, storage class and array and strings
Btech i pic u-4 function, storage class and array and stringsBtech i pic u-4 function, storage class and array and strings
Btech i pic u-4 function, storage class and array and strings
Rai University
 
Functions torage class and array and strings-
Functions torage class and array and strings-Functions torage class and array and strings-
Functions torage class and array and strings-
aneebkmct
 
Type header file in c++ and its function
Type header file in c++ and its functionType header file in c++ and its function
Type header file in c++ and its function
Frankie Jones
 
VHDL
VHDLVHDL
Diploma ii cfpc u-4 function, storage class and array and strings
Diploma ii  cfpc u-4 function, storage class and array and stringsDiploma ii  cfpc u-4 function, storage class and array and strings
Diploma ii cfpc u-4 function, storage class and array and strings
Rai University
 
function, storage class and array and strings
 function, storage class and array and strings function, storage class and array and strings
function, storage class and array and strings
Rai University
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
PriyadarshiniS28
 
Mcai pic u 4 function, storage class and array and strings
Mcai pic u 4 function, storage class and array and stringsMcai pic u 4 function, storage class and array and strings
Mcai pic u 4 function, storage class and array and strings
Rai University
 
Java Cheat Sheet
Java Cheat SheetJava Cheat Sheet
Java Cheat Sheet
Saeid Zebardast
 
C# overview part 1
C# overview part 1C# overview part 1
C# overview part 1
sagaroceanic11
 

Similar to C sharp_basic_ideas (20)

Csharp4 operators and_casts
Csharp4 operators and_castsCsharp4 operators and_casts
Csharp4 operators and_casts
 
C tutorial
C tutorialC tutorial
C tutorial
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
 
vb.net.pdf
vb.net.pdfvb.net.pdf
vb.net.pdf
 
Python programming unit 2 -Slides-3.ppt
Python programming  unit 2 -Slides-3.pptPython programming  unit 2 -Slides-3.ppt
Python programming unit 2 -Slides-3.ppt
 
CSharp Language Overview Part 1
CSharp Language Overview Part 1CSharp Language Overview Part 1
CSharp Language Overview Part 1
 
Bsc cs i pic u-4 function, storage class and array and strings
Bsc cs i pic u-4 function, storage class and array and stringsBsc cs i pic u-4 function, storage class and array and strings
Bsc cs i pic u-4 function, storage class and array and strings
 
Dr. Rajeshree Khande : Programming concept of basic java
Dr. Rajeshree Khande : Programming concept of basic javaDr. Rajeshree Khande : Programming concept of basic java
Dr. Rajeshree Khande : Programming concept of basic java
 
Dr. Rajeshree Khande : Java Basics
Dr. Rajeshree Khande  : Java BasicsDr. Rajeshree Khande  : Java Basics
Dr. Rajeshree Khande : Java Basics
 
Btech i pic u-4 function, storage class and array and strings
Btech i pic u-4 function, storage class and array and stringsBtech i pic u-4 function, storage class and array and strings
Btech i pic u-4 function, storage class and array and strings
 
Functions torage class and array and strings-
Functions torage class and array and strings-Functions torage class and array and strings-
Functions torage class and array and strings-
 
Type header file in c++ and its function
Type header file in c++ and its functionType header file in c++ and its function
Type header file in c++ and its function
 
VHDL
VHDLVHDL
VHDL
 
Diploma ii cfpc u-4 function, storage class and array and strings
Diploma ii  cfpc u-4 function, storage class and array and stringsDiploma ii  cfpc u-4 function, storage class and array and strings
Diploma ii cfpc u-4 function, storage class and array and strings
 
function, storage class and array and strings
 function, storage class and array and strings function, storage class and array and strings
function, storage class and array and strings
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Mcai pic u 4 function, storage class and array and strings
Mcai pic u 4 function, storage class and array and stringsMcai pic u 4 function, storage class and array and strings
Mcai pic u 4 function, storage class and array and strings
 
Java Cheat Sheet
Java Cheat SheetJava Cheat Sheet
Java Cheat Sheet
 
C# overview part 1
C# overview part 1C# overview part 1
C# overview part 1
 

C sharp_basic_ideas