SlideShare a Scribd company logo
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C#
Day 1
Lecture1: Basic
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
Environment
Tools required:
• The .NET Framework is a platform for building, deploying, and
running different types of Web and Desktop based Applications &
Web Services.
• Common Language Runtime (CLR): The .NET Framework contains a
run-time environment known as CLR which runs the codes. It
provides services to make the development process easy.
• Framework Class Library(FCL): It is a library of classes, value types,
interfaces that provide access to system functionality.
• An IDE (Integrated Development Environment) is a tool that helps to
write programs using different programming languages.
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)
Key Organizational Concepts in C#
C# is developed by Anders Hejlsberg at Microsoft in 2000 as a rival to
Java.
• Programs
• Namespaces
• Types
• member
Topic
• C# Environment
• Basic Syntax
• Data Types
• Type Casting
• Variables
• Operators
• Decision Making
• Loops
• Methods
• Arrays
• String
• Class
• Static Keyword
Features of C#
• simple, modern, object-oriented
• type-safe programming language
• component-oriented programming
• garbage collection
• exception handling
Basic Syntax: Write()
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.Write("I’m Jannat Binta Alam. And you?");
}
}
}
Basic Syntax: Read()
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.Write("I’m Jannat Binta Alam. And you?");
Console.Read();
}
}
}
Basic Syntax: Clear()
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.Write("I’m Jannat Binta Alam. And you?");
Console.Read();
Console.Clear();
}
}
}
Comment
• Single Line Comment
// comment
• Multiline Comment
/* first line
last line */
Your First Program
• Program Name: Hello Universe
• Author Name: Jannat Binta Alam
• Task: A Program to Print “Hello Universe”
• Date: 26th October, 2018: 8.30AM
Or 26.10.2018:8.30AM
Problem Set
• Write a program to print “Hello Universe! –Your Name” in console.
Hello Universe!
using System;
class Hello
{
static void Main()
{
Console.WriteLine("Hello Universe!");
Console.ReadKey();
}
}
Hello Universe!
class Hello
{
static void Main()
{
System.Console.WriteLine("Hello Universe!");
System.Console.ReadKey();
}
}
Basic Syntax: BackgroundColor
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.DarkBlue;
}
}
}
Basic Syntax: Read()
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.Read();
}
}
}
Basic Syntax: WriteLine()
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.WriteLine("C#: Learn to Build!");
Console.Read();
}
}
}
Basic Syntax: BackgroundColor
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.Clear();
Console.WriteLine("C#: Learn to Build!");
Console.Read();
}
}
}
Basic Syntax: ForegroundColor
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("C#: Learn to Build!");
Console.ReadKey();
}
}
}
Basic Syntax: Beep
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("C#: Learn to Build!");
Console.Beep(2100,1000); //(int frequency, int millisecond)
Console.ReadKey();
}
}
}
Basic Syntax: Color Variable
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
ConsoleColor col = Console.BackgroundColor;
Console.Write(col);
}
}
}
Basic Syntax: Color Variable
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.DarkBlue;
ConsoleColor col = Console.BackgroundColor;
Console.Write(col);
}
}
}
Basic Syntax: Color Variable
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
ConsoleColor col = Console.ForegroundColor;
Console.Write(col);
}
}
}
Basic Syntax: Color Variable
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Green;
ConsoleColor col = Console.ForegroundColor;
Console.Write(col);
}
}
}
Basic Syntax: Color Variable
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
ConsoleColor col = Console.BackgroundColor;
ConsoleColor col1 = Console.ForegroundColor;
Console.Write(col);
Console.Write(col1);
Console.Read();
}
}
}
Basic Syntax: CursorSize
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.CursorSize = 100; //range=1-100
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.Write(("C#: Learn to Build!“);
}
}
}
Basic Syntax: SetWindowSize()
using System;
namespace Basic_syntax
{
class Program
{
static void Main(string[] args)
{
Console.Write(("C#: Learn to Build!“);
Console.SetWindowSize(200, 50); //(width, height); max h=50.
}
}
}
This slide is provided as a course material in the workshop named
“Workshop on C# Programming: Learn to Build”.
Organized by-
East West University Computer Programming Club (EWUCoPC)
Prepared by-
Jannat Binta Alam
Campus Ambassador
Young Engineers Society (YES)
E-mail: jannat.cse.ewu@gmail.com

More Related Content

PPTX
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
PPTX
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
PPTX
32sql server
PPT
Python advanced 3.the python std lib by example –data structures
PPTX
Net framework
PPTX
Tools for reading papers
PPTX
Understanding the components of standard template library
PPT
Python advanced 3.the python std lib by example – algorithm
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
32sql server
Python advanced 3.the python std lib by example –data structures
Net framework
Tools for reading papers
Understanding the components of standard template library
Python advanced 3.the python std lib by example – algorithm

What's hot (20)

PDF
Reactive Programming in the Browser feat. Scala.js and PureScript
PDF
(Kpi summer school 2015) theano tutorial part1
PPT
2CPP16 - STL
PPTX
Constructor and destructor
PPTX
Theano tutorial
PDF
An Introduction to the C++ Standard Library
PPTX
Machine Learning in H2O
PPT
Python advanced 3.the python std lib by example – application building blocks
PPTX
Operators and expression in c++
PDF
Building a Tagless Final DSL for WebGL
PPTX
Stack Data structure
PDF
Cocoaheads Meetup / Alex Zimin / Swift magic
PPTX
Pa2 session 1
DOCX
Exp 6.1 d-422-1
PPT
Playing the toStrings
PPTX
Streams&io
PPTX
Lambda expressions
PDF
SQLGitHub - Access GitHub API with SQL-like syntaxes
PPTX
An introduction to java programming
Reactive Programming in the Browser feat. Scala.js and PureScript
(Kpi summer school 2015) theano tutorial part1
2CPP16 - STL
Constructor and destructor
Theano tutorial
An Introduction to the C++ Standard Library
Machine Learning in H2O
Python advanced 3.the python std lib by example – application building blocks
Operators and expression in c++
Building a Tagless Final DSL for WebGL
Stack Data structure
Cocoaheads Meetup / Alex Zimin / Swift magic
Pa2 session 1
Exp 6.1 d-422-1
Playing the toStrings
Streams&io
Lambda expressions
SQLGitHub - Access GitHub API with SQL-like syntaxes
An introduction to java programming
Ad

Similar to C# Basic - Lec1 (Workshop on C# Programming: Learn to Build) (20)

PDF
Intro to .NET and Core C#
PPTX
C # (C Sharp).pptx
PPTX
introduction to c #
PPTX
LECTURE 1 - Introduction to Programming.pptx
PPTX
Csharp introduction
PPTX
01. introduction to-programming
PPT
Intro.net
PPT
Introduction to Programming Lesson 01
PPTX
CS4443 - Modern Programming Language - I Lecture (1)
PPT
01 Introduction to programming
PPT
Runtime Environment Of .Net Divya Rathore
PPTX
C# lecture 1: Introduction to Dot Net Framework
PDF
C++ Windows Forms L01 - Intro
PPT
Nakov - .NET Framework Overview - English
PDF
C# for Java Developers
PPT
Nakov dot net-framework-overview-english
DOCX
Srgoc dotnet_new
PPT
Basics1
PPT
ASP.NET Session 3
Intro to .NET and Core C#
C # (C Sharp).pptx
introduction to c #
LECTURE 1 - Introduction to Programming.pptx
Csharp introduction
01. introduction to-programming
Intro.net
Introduction to Programming Lesson 01
CS4443 - Modern Programming Language - I Lecture (1)
01 Introduction to programming
Runtime Environment Of .Net Divya Rathore
C# lecture 1: Introduction to Dot Net Framework
C++ Windows Forms L01 - Intro
Nakov - .NET Framework Overview - English
C# for Java Developers
Nakov dot net-framework-overview-english
Srgoc dotnet_new
Basics1
ASP.NET Session 3
Ad

More from Jannat Ruma (8)

PPTX
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
PPTX
Class C# - Lec11 (Workshop on C# Programming: Learn to Build)
PPTX
String C# - Lec10 (Workshop on C# Programming: Learn to Build)
PPTX
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)
PPTX
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)
PPTX
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)
PPTX
Variable C# - Lec5 (Workshop on C# Programming: Learn to Build)
PPTX
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
Class C# - Lec11 (Workshop on C# Programming: Learn to Build)
String C# - Lec10 (Workshop on C# Programming: Learn to Build)
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)
Variable C# - Lec5 (Workshop on C# Programming: Learn to Build)
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
master seminar digital applications in india
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Basic Mud Logging Guide for educational purpose
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Microbial disease of the cardiovascular and lymphatic systems
Supply Chain Operations Speaking Notes -ICLT Program
Module 4: Burden of Disease Tutorial Slides S2 2025
O5-L3 Freight Transport Ops (International) V1.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Microbial diseases, their pathogenesis and prophylaxis
PPH.pptx obstetrics and gynecology in nursing
FourierSeries-QuestionsWithAnswers(Part-A).pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Cell Types and Its function , kingdom of life
master seminar digital applications in india
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
human mycosis Human fungal infections are called human mycosis..pptx
Basic Mud Logging Guide for educational purpose
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Renaissance Architecture: A Journey from Faith to Humanism
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Final Presentation General Medicine 03-08-2024.pptx

C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)

  • 4. Environment Tools required: • The .NET Framework is a platform for building, deploying, and running different types of Web and Desktop based Applications & Web Services. • Common Language Runtime (CLR): The .NET Framework contains a run-time environment known as CLR which runs the codes. It provides services to make the development process easy. • Framework Class Library(FCL): It is a library of classes, value types, interfaces that provide access to system functionality. • An IDE (Integrated Development Environment) is a tool that helps to write programs using different programming languages.
  • 8. Key Organizational Concepts in C# C# is developed by Anders Hejlsberg at Microsoft in 2000 as a rival to Java. • Programs • Namespaces • Types • member
  • 9. Topic • C# Environment • Basic Syntax • Data Types • Type Casting • Variables • Operators • Decision Making • Loops • Methods • Arrays • String • Class • Static Keyword
  • 10. Features of C# • simple, modern, object-oriented • type-safe programming language • component-oriented programming • garbage collection • exception handling
  • 11. Basic Syntax: Write() using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.Write("I’m Jannat Binta Alam. And you?"); } } }
  • 12. Basic Syntax: Read() using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.Write("I’m Jannat Binta Alam. And you?"); Console.Read(); } } }
  • 13. Basic Syntax: Clear() using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.Write("I’m Jannat Binta Alam. And you?"); Console.Read(); Console.Clear(); } } }
  • 14. Comment • Single Line Comment // comment • Multiline Comment /* first line last line */
  • 15. Your First Program • Program Name: Hello Universe • Author Name: Jannat Binta Alam • Task: A Program to Print “Hello Universe” • Date: 26th October, 2018: 8.30AM Or 26.10.2018:8.30AM
  • 16. Problem Set • Write a program to print “Hello Universe! –Your Name” in console.
  • 17. Hello Universe! using System; class Hello { static void Main() { Console.WriteLine("Hello Universe!"); Console.ReadKey(); } }
  • 18. Hello Universe! class Hello { static void Main() { System.Console.WriteLine("Hello Universe!"); System.Console.ReadKey(); } }
  • 19. Basic Syntax: BackgroundColor using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.DarkBlue; } } }
  • 20. Basic Syntax: Read() using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.DarkBlue; Console.Read(); } } }
  • 21. Basic Syntax: WriteLine() using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.DarkBlue; Console.WriteLine("C#: Learn to Build!"); Console.Read(); } } }
  • 22. Basic Syntax: BackgroundColor using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.DarkBlue; Console.Clear(); Console.WriteLine("C#: Learn to Build!"); Console.Read(); } } }
  • 23. Basic Syntax: ForegroundColor using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("C#: Learn to Build!"); Console.ReadKey(); } } }
  • 24. Basic Syntax: Beep using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("C#: Learn to Build!"); Console.Beep(2100,1000); //(int frequency, int millisecond) Console.ReadKey(); } } }
  • 25. Basic Syntax: Color Variable using System; namespace Basic_syntax { class Program { static void Main(string[] args) { ConsoleColor col = Console.BackgroundColor; Console.Write(col); } } }
  • 26. Basic Syntax: Color Variable using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.DarkBlue; ConsoleColor col = Console.BackgroundColor; Console.Write(col); } } }
  • 27. Basic Syntax: Color Variable using System; namespace Basic_syntax { class Program { static void Main(string[] args) { ConsoleColor col = Console.ForegroundColor; Console.Write(col); } } }
  • 28. Basic Syntax: Color Variable using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Green; ConsoleColor col = Console.ForegroundColor; Console.Write(col); } } }
  • 29. Basic Syntax: Color Variable using System; namespace Basic_syntax { class Program { static void Main(string[] args) { ConsoleColor col = Console.BackgroundColor; ConsoleColor col1 = Console.ForegroundColor; Console.Write(col); Console.Write(col1); Console.Read(); } } }
  • 30. Basic Syntax: CursorSize using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.CursorSize = 100; //range=1-100 Console.ForegroundColor = ConsoleColor.DarkRed; Console.Write(("C#: Learn to Build!“); } } }
  • 31. Basic Syntax: SetWindowSize() using System; namespace Basic_syntax { class Program { static void Main(string[] args) { Console.Write(("C#: Learn to Build!“); Console.SetWindowSize(200, 50); //(width, height); max h=50. } } }
  • 32. This slide is provided as a course material in the workshop named “Workshop on C# Programming: Learn to Build”. Organized by- East West University Computer Programming Club (EWUCoPC) Prepared by- Jannat Binta Alam Campus Ambassador Young Engineers Society (YES) E-mail: jannat.cse.ewu@gmail.com