Class 2
Class 2
======
Project(Namespace) - Myproject
Collection of classes
Solution -
collection of projects
Class
collection of methods and members
C#
====
output statements
=======================
Console.Write()
Console.WriteLine()
input statements
==========================
Console.Read()
Console.ReadLine()
Console.Readkey()
DataTypes
int a=10;
a -> integer variable
10 -> integer value
Value Type
int,float,decimal....etc
Arithmetic operators - + - / % *
Assignment operators - = ?=
Comparison operators - > < >= <=
Equality operators - = ==
Boolean logical operators - true / false
Betwise and shift operators - && ||
Member access operators
Type-cast operators
Pointer related operators
Conditional statements
=======================
if
if else
else if
nested if
switch
syntax
==========
if(condition) - true
{
}
else
{
Debug
===========
F9 - break point
F11 - step into
F10 - step out
using System;
namespace MyfirstConsole
{
internal class Program
{
static void Main()
{
byte age = 0;
Console.WriteLine("please enter your age");
age = byte.Parse(Console.ReadLine());
Console.ReadKey();
}
}
=================
using System;
namespace MyfirstConsole
{
internal class Program
{
static void Main()
{
byte age = 0;
age = byte.Parse(Console.ReadLine());
Console.ReadKey();
}
}
=============================
using System;
namespace MyfirstConsole
{
internal class Program
{
static void Main()
{
int atm = 0;
atm = int.Parse(Console.ReadLine());
if (atm == 5674)
{
Console.WriteLine("Welcome to Axis Bank");
}
else
{
Console.WriteLine("Please enter correct pin!");
}
Console.ReadKey();
}
}
==============================