Using Operators in C# Operators Expressions in C# comprise of one or more operators that performs some operations on variables. An operation is an action performed on single or multiple values stored in variables in order to modify them or to generate a new value. Therefore, an operation takes place with the help of minimum one symbol and a value. The symbol is called an operator and it determines the type of action to be performed on the value. The value on which the operation is to be performed is called an operand. An operand might be a complex expression. For example, (X * Y) + (X – Y) is a complex expression, where the + operator is used to join two operands. Types of Operators Operators are used to simplify expressions. In C#, there is a predefined set of operators used to perform various types of operations. C# operators are classified into six categories based on the action they perform on values. These six categories of operators are as follows: Arithmetic Operat...
Javascript array The Array is used to store multiple values in a single variable. What is an Array? An array is a special variable, which can hold more than one value, at a time. If you have a list of items (a list of car names, for example), storing the cars in single variables look like this: cars1=" Honda "; cars2=" Suzuki "; cars3=" BMW "; Create an Array An array can be defined in three ways. The following code creates an Array object called myCars: 1. var myCars=new Array(); // regular array(add an optional integer // argument to control array’s size) myCars[0]=”Honda”; myCars[1]=”Suzuki”; myCars[2]=”BMW”; 2. var myCars=new Array(“Honda”,”Suzuki”,”BMW”); // condensed array 3. var myCars=[“Honda”,”Suzuki”,”BMW”]; // literal array Demonstrate the use of array in javascript <!DOCTYPE HTML> <html> <head> <title> JavaScript Language </title> <script type=" text / ja...