Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views52 pages

C Introduction

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 52

...

Guess the zoomed picture


_ _ _ _u _ _ _ t_ _ _ _ _
V _ _l S_ t_ u_ _d _i o_
_ _i s_ u_ a
__a
__ ___
C_ h_ _a _t G_ _P _T
____
W
_ _o _r _d
_ _ _o _ _ _ _ _ _ _ _ _
G
_ _o _o _g_l e_ C_ h_ r_ o_ m
_ _e
C
_ _____
C
_ S_ h
_ _a _r _p
_ _w
________
P_ _o _w_e_r_p_o_i n_ t_
_ k_ _ _ _
S_ _k _y _p_e
_ _ _ _r _ _ _ _ _
_M_i c_ _r o_ _s _o _f t_
_ x_ _ _ _
_E _x _c _e_l
____
_J _a _v _a
_____b
_
G
_ _i t_ H_ u_ b_
_ _ _ c_ _ _ _
_D _i s_ c_ o_ r_ d_
_ _ _ _ _i _
R_ _e _d _d _i t_
_ _ _ _ _b _ _ _
F_ a_ c_ e_ b_ _o _o _k
_ n_ _ _ _
U
_ _n _i t_y_
C#
?
??
(C-Sharp)
Presented by Group 3
TOPICS:

Brief History C#
C# syntax
of C# introduction

C#
C# output
comments
Brief History of C#
C# is an object-oriented programming language
provided by Microsoft that runs on .Net Framework. It is
used to develop web apps, desktop apps, mobile apps,
games and much more.

Anders Hejlsberg is known as


the founder of C# language.
Some of popular apps are built using
C# such as:

Microsoft Office Suite


Microsoft Outlook
Microsoft Skype
Turbo Pascal in 1989 Microsoft Teams
Delphi in 1995 AutoCAD
C# in 2002
C# Features
Simple
Modern programming language
Object oriented
Type safe
Interoperability
Scalable and Updateable
Component oriented
Structured programming language
Rich Library
Fast speed
C# Introduction
What is C#?

C# is pronounced "C-Sharp".

The C# language is one of the most demanding language and


it is general purpose programming language.

C# is Fully object oriented programming language. It


covers all the features of the object oriented programming like
what????
C# Introduction

C# has roots from the C family, and the language is close to


other popular languages like C++ and Java.

The first version was released in year 2002. The latest version,
C# 12, was released in November 2023.

Fun fact: C# was originally titled COOL, a clever acronym that


stood for “C-like Object Oriented Language.”
Why Use C#?
It is one of the most popular programming
languages in the world
C# is used for:
It is easy to learn and simple to use Mobile applications
Desktop applications
It has huge community support Web applications
Web services
C# is an object-oriented language which
gives a clear structure to programs and
Web sites
allows code to be reused, lowering Games
development costs VR
Database applications
As C# is close to C, C++ and Java, it makes it
easy for programmers to switch to C# or vice
versa
C# IDE
The easiest way to get started with C# is to use an IDE.
An IDE (Integrated Development Environment) is used to edit and compile code.

C# Install
Create a new project

Install more tools and features


Enter a name for your project, and click on the Create button
Visual Studio will automatically generate some code for your project
C# Syntax

Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}
C# Output
To output values or print text in C#, you can use the WriteLine()
method:
Example:

Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}

Other Examples:
C# Output
You can also output numbers, and perform mathematical
calculations:

Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}

The Write Method


There is also a Write() method, which is similar to WriteLine().
C# Comments
Comments can be used to explain C# code, and to make it more readable.
It can also be used to prevent execution when testing alternative code.

Single-line Comments
Single-line comments start with two forward slashes (//).
Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}

Any text between // and the end of the line is ignored by C# (will
not be executed).

This example uses a single-line comment before a line of code:


1. int sum = 5 + 3; // This calculates the sum of 5 and 3

Create a n
C# Multi-line Comments
Multi-line comments start with /* and ends with
*/.
Any text between /* and */ will be ignored by
C#. Create a new projectCreate a new projectusing System;namespace HelloWorld{class Program{static void Main(string[] args){
Console.WriteLine("Hello World!");}}}

This example uses a multi-line comment (a


comment block) to explain the code:
1. /* This code calculates the area of
a rectangle using the formula
2. int are = length * width
Create a ne
Thank you
for
listening!

You might also like