Chapter1_Fundamentals of C.pdf - Fundamentals of C Chapter...

This preview shows page 1 - 10 out of 45 pages.

Fundamentals of C # Chapter 1 70-483
Image of page 1

Subscribe to view the full document.

Objective 1. Write your first program in C#. 2. Work with variables, primitive data types & operators . 3. Use implicit & explicit type casting . 4. Use var keyword. 5. Work with arrays . 6. Define decision structure . 7. Define decision operators . 8. Work with loops . 9. Use jump statements . 10. Use & define methods .
Image of page 2
Program Structure & Language Fundamentals Write first program in C# 1. using : statement helps to import namespace in the program. These namespaces have types that we can use to develop applications. 2. namespace FirstProject : C# strictly follows object-oriented design. Therefore, when we created an empty console project, it creates a namespace with a project name. Inside namespace we write types for our project. 3. class Program : C# creates a default class inside namespace called “Program”. Inside classes we write methods, fields, properties, and events that we can reuse in the project. 4. Main : C# program must contain a main method. It is where execution of the program begins.
Image of page 3

Subscribe to view the full document.

Program Structure & Language Fundamentals Variables & Data Types Data is everywhere . Our job as a developer is to manipulate data and produce required results. Data have numerous types (for example, text, audio, and video, etc.). Each type of data can hold a different size in memory. The same concept applies while writing an application in C#. We have variables to store data and data types to describe what type/size of data can be stored in a variable. Syntax Date_Type Variable_Name = Value; Code Snippet Initialize an integer variable “age” int age = 10;
Image of page 4