Posts

Showing posts from April, 2022

C# Function

  *C# function  Q. How to create function in C#. ans. All function is to be created before the main body .            All function is to be access inside the main body. *For loop         3 parts are compulsory  1) variable  2) condtion 3) Increament / denement *Function access inside the main body usinng object. Q.How to create object ? ans. All object create inside the main body.                  New = memory allocation .      Syntax.               object      classname objectname = newclassname(); *Object is used to accessing Function. *Syntax   objectname. Function(); e.g Pl ( access operator ) display(); Note: All the program is to be in main body.

Variable

  Variable           variable is a name of memory location where user can store different type of data value. Note: Name-Int(integer)           Decimal-Float           String/Name-String *In C# accepting data using readline(); *In C# print any number i/p use int.parse()   *condition statement in C# 1) if 2) if else 3) else if 4) switch case *switch case execute multiple program in a single choise. *Looping          Repetation of statement is called a looping  e.g 1) while loop        2) do while       3) for loop *Writeline - one by one