Friday, July 31, 2015

Loop

 Loop 



 C# provides following types of loop to handle looping requirements. Click the following links to check their detail.

Loop Type                                            Description 

while loop                         It repeats a statement or a group of statements while a given condition is                                                true.     It tests   the condition before executing the loop body.
for loop                           It executes a sequence of statements multiple times and abbreviates the code                                         that  manages the loop variable.
do...while loop                It is similar to a while statement, except that it tests the condition at the end                                         of the loop body
nested loops                 You can use one or more loops inside any another while, for or do..while                                               loop.

While Loop

 A while loop statement in C# repeatedly executes a target statement as long as a given condition is true. 
Syntax The syntax of a while loop in C# is: 
while(condition) 
   statement(s); 


Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and true is any non-zero value. The loop iterates while the condition is true. When the condition becomes false, program control passes to the line immediately following the loop. 


using System;  
namespace Loops 
     
    class Program 
    { 
        static void Main(string[] args) 
        { 
            /* local variable definition */ 
            int a = 10;  
/* while loop execution */ 
            while (a < 20) 
            { 
                Console.WriteLine("value of a: {0}", a); 
                a++; 
            } 
            Console.ReadLine(); 
        } 
    } 
}

code output
value of a: 10 
value of a: 11 
value of a: 12 
value of a: 13 
value of a: 14 
value of a: 15 
value of a: 16 
value of a: 17 
value of a: 18 
value of a: 19 


For Loop

A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times. 

Syntax

 The syntax of a for loop in C# is: 
for ( init; condition; increment ) 

  statement(s); 
}
                         


Here is the flow of control in a for loop:
 1. The init step is executed first, and only once. This step allows you to declare and initialize any loop control variables. You are not required to put a statement here, as long as a semicolon appears. 2. Next, the condition is evaluated. If it is true, the body of the loop is executed. If it is false, the body of the loop does not execute and flow of control jumps to the next statement just after the for loop. 
3. After the body of the for loop executes, the flow of control jumps back up to the increment statement. This statement allows you to update any loop control variables. This statement can be left blank, as long as a semicolon appears after the condition. 
4. The condition is now evaluated again. If it is true, the loop executes and the process repeats itself (body of loop, then increment step, and then again testing for a condition). After the condition becomes false, the for loop terminates. 
  

Example 

using System;  
namespace Loops 
     
    class Program 
    { 
        static void Main(string[] args) 
        { 
            /* for loop execution */ 
            for (int a = 10; a < 20; a = a + 1)
         { 
                Console.WriteLine("value of a: {0}", a); 
            } 
            Console.ReadLine(); 
        } 
    } 
}  
When the above code is compiled and executed, it produces the following result: 
value of a: 10 
value of a: 11 
value of a: 12 
value of a: 13 
value of a: 14 
value of a: 15 
value of a: 16 
value of a: 17 
value of a: 18 
value of a: 19 


Example for switch case

Example for switch case

using System;
namespace DecisionMaking
{
   
    class Program
    {
        static void Main(string[] args)
      {
            /* local variable definition */
            char grade = 'B';
            switch (grade)
            {
                case 'A':
                    Console.WriteLine("Excellent!");
                    break;
                case 'B':
                case 'C':
                    Console.WriteLine("Well done");
                    break;
                case 'D':
                    Console.WriteLine("You passed");
                    break;
                case 'F':
                    Console.WriteLine("Better try again");
                    break;
                default:
                    Console.WriteLine("Invalid grade");
                    break;
            }
            Console.WriteLine("Your grade is  {0}", grade);
            Console.ReadLine();
        }
    }

Switch Statement

Switch Statement

 A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.
Syntax The syntax for a switch statement in C# is as follows:
switch(expression){
    case constant-expression  :
       statement(s);
       break; /* optional */
    case constant-expression  :
       statement(s);
       break; /* optional */
 
    /* you can have any number of case statements */
    default : /* Optional */
       statement(s);
}
The following rules apply to a switch statement:
  The expression used in a switch statement must have an integral or enumerated type, or be of a class type in which the class has a single conversion function to an integral or enumerated type.
  You can have any number of case statements within a switch. Each case is followed by the value to be compared to and a colon.
  The constant-expression for a case must be the same data type as the variable in the switch, and it must be a constant or a literal.
When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached.
 When a break statement is reached, the switch terminates, and the flow of control jumps to the next line following the switch statement.
 Not every case needs to contain a break. If no break appears, the flow of control will fall through to subsequent cases until a break is reached.
 A switch statement can have an optional default case, which must appear at the end of the switch. The default case can be used for performing a task when none of the cases is true. No break is needed in the default case.

Nested if Statements

Nested if Statements

 It is always legal in C# to nest if-else statements, which means you can use one if or else if statement inside another if or else if statement(s).
Syntax The syntax for a nested if statement is as follows:
if( boolean_expression 1)
{
   /* Executes when the boolean expression 1 is true */
   if(boolean_expression 2)
   {
      /* Executes when the boolean expression 2 is true */
   }
}


Example:-

using System; 
namespace DecisionMaking 
     
    class Program 
    { 
        static void Main(string[] args) 
        {  
            //* local variable definition */ 
            int a = 100; 
            int b = 200;  
            /* check the boolean condition */ 
            if (a == 100) 
            { 
                /* if condition is true then check the following */ 
                if (b == 200) 
                { 
                    /* if condition is true then print the following */ 
                    Console.WriteLine("Value of a is 100 and b is 200"); 
                } 
            } 
            Console.WriteLine("Exact value of a is : {0}", a); 
            Console.WriteLine("Exact value of b is : {0}", b); 
            Console.ReadLine(); 
        } 
    } 

The if...else

The if...else 

if...else Statement An if statement can be followed by an optional else if...else statement, which is very useful to test various conditions using single if...else if statement. When using if, else if and else statements there are few points to keep in mind.  An if can have zero or one else's and it must come after any else if's.  An if can have zero to many else if's and they must come before the else.  Once an else if succeeds, none of the remaining else if's or else's will be tested.

Syntax 

The syntax of an if...else if...else statement in C# is:
if(boolean_expression 1)
{
   /* Executes when the boolean expression 1 is true */
}
else if( boolean_expression 2)
{
   /* Executes when the boolean expression 2 is true */
}
else if( boolean_expression 3)
{
   /* Executes when the boolean expression 3 is true */
}
else
{
   /* executes when the none of the above condition is true */
}

ex:-
using System; 
namespace DecisionMaking 
    class Program 
    { 
        static void Main(string[] args) 
        {  
            /* local variable definition */ 
            int a = 100;  
            /* check the boolean condition */ 
            if (a == 10) 
            { 
                /* if condition is true then print the following */ 
                Console.WriteLine("Value of a is 10"); 
            } 
            else if (a == 20) 
            { 
                /* if else if condition is true */ 
                Console.WriteLine("Value of a is 20"); 
            } 
            else if (a == 30) 
            { 
                /* if else if condition is true  */ 
                Console.WriteLine("Value of a is 30"); 
            } 
            else 
          { 
                /* if none of the conditions is true */ 
                Console.WriteLine("None of the values is matching"); 
            } 
            Console.WriteLine("Exact value of a is: {0}", a); 
            Console.ReadLine(); 
        } 
    } 

if...else Statement

if...else Statement

 An if statement can be followed by an optional else statement, which executes when the boolean expression is false.
Syntax The syntax of an if...else statement in C# ,c,++ is:
if(boolean_expression)
{
   /* statement(s) will execute if the boolean expression is true */
}
else
{
  /* statement(s) will execute if the boolean expression is false */
}

example

using System; 
namespace DecisionMaking 
     
    class Program 
    { 
        static void Main(string[] args) 
        { 
            /* local variable definition */ 
            int a = 100;  
            /* check the boolean condition */ 
            if (a < 20) 
            { 
                /* if condition is true then print the following */ 
                Console.WriteLine("a is less than 20"); 
            } 
            else 
            { 
                /* if condition is false then print the following */ 
                Console.WriteLine("a is not less than 20"); 
            } 
            Console.WriteLine("value of a is : {0}", a); 
            Console.ReadLine(); 
        } 
    } 

if Statement in c,c++,c#

if Statement 

An if statement consists of a boolean expression followed by one or more statements.
Syntax The syntax of an if statement in C#  and c ,c++ is:
if(boolean_expression)
{
   /* statement(s) will execute if the boolean expression is true */
}

Example


using System;
namespace DecisionMaking
{
   
    class Program
    {
        static void Main(string[] args)
        {
            /* local variable definition */
            int a = 10;
            /* check the boolean condition using if statement */
            if (a < 20)
            {
                /* if condition is true then print the following */
                Console.WriteLine("a is less than 20");
            }
            Console.WriteLine("value of a is : {0}", a);
            Console.ReadLine();
        }
    }
}

Thursday, July 30, 2015

Windows 10

Download WINdows 10 this site

https://www.microsoft.com/en-us/software-download/windows10

HUB

HUB

A hub is a central network device used to connect multiple nodes to form a single network. It contains a number of ports to connect multiple computers. When a computer connected to a hub needs to communicate, it sends data packets to the hub. When a data packet arrives at the hub, it broadcasts the data packet to all devices in the network. The destined recipient whose Media Access Control (MAC) address is mentioned in the data packet receives it,
and all the other devices discard the data packet. The following figure shows a hub.


A Hub This method of transmitting a data packet is inefficient because all the nodes receive the data packet even if the data packet is not meant for them. In addition, when the data packets are on the network, the network cannot be used by other devices, which results in network traffic. This wastes network bandwidth. It also causes security problems because all the nodes can read the data packet sent by the hub. When two nodes simultaneously send the data packet to the hub, a collision occurs. When this collision occurs, the message becomes unreadable and the network must reset itself before delivering the data packet again. A hub can have 5, 8, 16, or more ports depending on its size. In addition, a hub contains a port, known as uplink port, which is used to connect with the next hub.

NOTE

A data packet is a basic unit of communication on a network. The data always travels in the form of data packets in a network.
A MAC address is a binary address unique to a single network. This address is 4 8 -bit long and is used to identify each node of a network uniquely.

WHAT IS NETWORK DEVICES?

WHAT IS NETWORK DEVICES?

Network Devices
In a small network, you can connect computers directly with the help of cables. However, in a large network, such as MAN, connecting computers with each other directly through cables is difficult. In addition, it may cause problems in managing the network. In such cases, you need hardware devices to set up a network. You can place these devices in a network and connect each node on the network with them. Various hardware devices are required to establish a network connection. These devices are collectively known as communication devices. The commonly used communication devices in a network are:

  • Hub
  •  Switch
  •  Router 
  • Bridge
  •  Gateway 
  • Modem


Wireless Network

Wireless Network

Mobile communication and connectivity over networks have become indispensable with the increased use of laptops, cell phones, and other mobile communication devices. For an individual who is located away from the main office network, physical connectivity with the office network is not always possible. In these situations, wireless connectivity proves useful. The advantage of the wireless technology is that it helps connect distant networks without needing to physically set up cables between the destination and source points. A wireless setup uses the atmosphere to transmit and receive signals in the form of electro-magnetic waves using an antenna. The electro-magnetic waves can be transmitted through different types of wireless transmission carriers, which include the following:
  1. Radio
  2.  Microwave
  3.  Bluetooth

Radio

 Radio transmissions operate on radio waves. Radio waves are electro-magnetic waves used for transmitting audio signals, video signals, and data. Radio waves are less expensive than other wireless media and are relatively easy to install. However, they require skilled personnel to implement them. Radio waves are only limited to low transmission capacities, from 1 Mbps to 10 Mbps. If low- power devices are used, they may also suffer from weakening and distortion. However, with high power devices, the attenuation rate is much lower. The limitation of radio waves is that they are susceptible to EMI and eavesdropping, which allow outsiders to tap into an ongoing transmission. As a result, they are not recommended for confidential information exchanges. The following figure shows a radio transmission tower.

Microwave

 Microwave transmissions send data over a higher bandwidth than radio transmissions. Although microwaves support higher bandwidths and longer distances, they are more expensive than radio waves. The greater the range of transmission, the more expensive is the microwave transmissions. Microwave transmissions setups are difficult to install as they require extreme precision. In addition, their transmission is affected by atmospheric conditions, such as rain and fog. Similar to radio waves, microwaves are also susceptible to EMI and eavesdropping. 


Bluetooth 

A Bluetooth is a network standard that defines how two Bluetooth-enabled devices transmit data using short-range radio waves. To establish communication between two Bluetooth devices, the devices must be within 10 meters of range. The data between Bluetooth devices is transferred at a maximum rate of 3 Mbps. A Bluetooth device contains a small chip that enables it to communicate with other Bluetooth-enabled devices. Some examples of Bluetooth-enabled devices are laptops, cell phones, digital cameras, microphones, and printers. When two computers share data through Bluetooth, the recipient computer has a choice of accepting or declining the data. The following figure shows the logo of Bluetooth.







Network Media

Network Media

The physical channel that connects network components, such as nodes and printers, is known as transmission medium or network medium. The transmission medium determines speed and connectivity of the network, the resulting overall performance of the network, and the investment required to set up the network. The two types of network media are:


Cables : 

Cables connect networks over short distances. Different types of cables that can be used to set up networks include twisted pair cables, coaxial cables, and fiber optic cables.

Wireless :

 Wireless transmission channel connect mobile computers, such as laptops and PDAs, over a network. Various types of wireless transmission media are radio wave and microwave media.

Based on the type of media in the network, you can form wired network or a wireless network.


Wired Network
Cables are conventional media that is used to set up wired networks. 
The following types of cables are available to set up a wired network:
  • Twisted pair cable
  •  Coaxial cable 
  • Fiber optic cable
  •  Twisted Pair Cable 

Twisted pair cables

 are the most widely used cables for setting up networks. A twisted pair cable uses copper wires, which are good conductors of electricity. However, when two copper wires are placed in close proximity, they interfere with each other’s transmission, resulting in EMI. This is known as crosstalk. In a twisted pair network cable, multiple pairs of wires are twisted around each other at regular intervals. The twists negate the electro- magnetic field and reduce network crosstalk . Twisted pair cables are easy to set up, economical, and widely available media for network transmission. However, this media cannot be used in areas where network security is critical or the network is close to electronically sensitive equipment that may prove to be a potential source of EMI. Twisted pair cables are of the following types:
  1. Unshielded Twisted Pair (UTP) cables
  2.  Shielded Twisted Pair (STP) cables

 Unshielded Twisted Pair Cables 

UTP cables are the most commonly used cabling media. This type of cable is generally used in telephone systems. UTP cables consist of a set of twisted pairs that are covered with a plastic jacket. However, this plastic jacket does not provide any protection against EMI. To ensure that data transmission is not disrupted due to EMI, UTPs are not installed in close proximity to electro-magnetic devices. Another problem related to these cables is the signals that the UTP cables carry undergo rapid attenuation. As a result, the recommended length of these cables is not more than 100 meters. 



Shielded Twisted Pair Cables 

STP cables consist of multiple twisted pairs surrounded by an insulator shield. This shield protects the copper-based core from EMI. This insulator shield, in turn, is covered with a plastic encasement.
STP cables are protected against EMI by two layers. As a result, they are less sensitive to EMI and interference. However, STP cable shielding should be grounded to prevent interference in the cable. In addition, as compared to UTP, STP cables offer higher transmission rates - from 16 Mbps to 155 Mbps. Despite high transmission rates, STP cables have a number of limitations. They are expensive and not as widely available as UTP and coaxial cables. STP cables are not implemented commonly on large networks because of their incompatibility with the normal telephone cabling. 

Coaxial cables, 

commonly referred to as coax cables, derive their name from their structure. The structure is designed in a way that the two conductors share a common axis. The structure of the coaxial cable consists of a center conductor responsible for transmitting data. The outer conductor or shield protects this center conductor from EMI, ensuring that data transmission is not disrupted. The insulator provides a uniform space between the two conductors. A plastic jacket covers the cable and protects it from damage.

Fiber Optic Cable

 Fiber optic cables are based on fiber optic technology, which uses light rays or laser rays instead of electricity to transmit data. This makes fiber optics a suitable carrier of data in areas that are prone to high levels of EMI or for long distance data transmissions, where electrical signals may be significantly distorted and degraded. The components of a fiber optic cable include light- conducting fiber, cladding, and insulator jacket. The cladding covers core fiber and prevents light from being reflected through the fiber and the insulating jacket. The outer covering (or the insulator jacket) is responsible for providing required strength and support to the core fiber as well as for protecting the core fiber from breakage or high temperature. The fiber optical cables can have single or multiple paths for light rays. Based on this, fiber optic cables can be differentiated into the following categories:

Single mode cables : 

These cables use single mode fiber, which provides a single path for light rays to pass through the cables. A single mode fiber is suitable for carrying data over long distances. The following figure shows a single mode cable.

Multimode cables :

 These cables use multimode fiber, which provide multiple paths for light rays to pass through. Light rays are unaffected by large distances or environment, the signals do not attenuate or suffer from EMI or other interferences. This makes multimode cables extremely safe and prevents outsiders from eavesdropping on an ongoing transmission.












IP

IP ADDRESS

An IP address is a unique number that identifies a resource in a network. The first part of the IP address identifies the network in which the host resides, and the second part identifies the host in the network. This can be explained in the context of the postal system. The postal address on a letter has the complete address of the receiver, including the house number, street name and number, city, and state. Using this address, the postal system identifies the exact house or office for delivering the letter.


  1. Move the cursor to the bottom right of the screen to display the Charms bar, and then select Search . The apps page is displayed on the screen, with the Search pane on the right side.
  2.  Select Settings in the Search pane , and then type Network and Sharing Center in the search box. The results are displayed in the Settings screen. 
  3. Select the Network and Sharing Center tile from the results. The Network and Sharing Center window is displayed. 
  4. Click the Change adapter settings link in the left pane. The Network Connections window is displayed. Right-click the active network adapter, and then select Properties . 

If the User Account Control dialog box is displayed, you need to provide the administrator credentials. If you already have the administrative rights, then you need to click the Yes button.
 5.Select the Internet Protocol Version (TCP/ IPv4) option under the This connection uses the following items section.
6. Click the Properties button. The Internet Protocol Version 4 (TCP/IPv4) Properties dialog box is displayed.
7.Ensure that the Use the following IP address option is selected.
8.Type the IP address provided by tech support in the IP address text box. Type the Subnet mask provided by tech support in the Subnet mask text box.
9.Subnet mask is used to define the network and host portion of an IP address.
10.Type the default gateway provided by your ISP in the Default gateway text box.
11.Ensure that the Use the following DNS server addresses option is selected.
12. Type the preferred DNS server provided by your ISP in the Preferred DNS server text box.
13.Click the OK button.
14.Click the Close button.

NOTE

Domain Name Server (DNS) address is used to define the servers that maintain the database, which maps IP addresses with the domain name of the servers, such as yahoo.com, and Universal Resource Locators (URLs) of websites, such as www.yahoo.com. DNS is used to perform one simple task of converting IP addresses to domain names that can be easily understood by everyone. It can be compared with the phone book. For example, if you know someone’s name but do not know his/her number, you can look up in the phone book to search for the number. DNS provides the similar service. For example, when you use the URL in a Web browser to visit a Web site, the computer uses the DNS service to retrieve the IP address of the site.

Network topology

. In a network based on the tree topology:




A child can only directly communicate with its parent and with no other node in the network. A parent can only directly communicate with its children and with its own parent. While sending a message from one node to another, the message must travel from the source node up the tree to the nearest common ancestor and then down the tree to the destination node.

 Hybrid topology

The hybrid topology is not a basic topology. However, it can be a combination of two or more basic topologies, such as bus, ring, star, mesh, or tree. For example, a star network can be connected to another bus network, which is further connected to a ring network. This new network, formed by two or more sub-networks of different
topologies, will be of a hybrid topology.



Network Topologies

Network Topologies

You can place the computers and other devices in a network in different physical layouts, termed as network topologies. The network topology is a schematic layout or map of the arrangement of nodes over a network. This layout also determines the manner in which information is exchanged within the network. The different types of network topologies that can be used to set up a network are:


  • Bus
  •  Star 
  • Ring 
  • Mesh 
  • Tree
  •  Hybrid

BUS

The bus topology connects all the nodes on a network to a main cable called bus. 




The star topology connects nodes over a network using a central control unit called the hub. The hub is a device that transmits information from one node to another. 

ring topology , each node in a network is connected with two adjacent nodes and, therefore, forms a circle. The ring topology connects the nodes on a network through a point- to-point connection. 





 in mesh topology , each node in a network is directly connected with every other node in the network. The mesh topology involves point-to-point connections between all the nodes on a network. 



Network Architecture

 Network Architecture


Computers and other devices connected on a network can interact with each other in many ways depending on the architecture of the network. The architecture of a network is a logical design that determines how devices in the network communicate. The commonly used architectures for computer networks are:

  • The Client-server architecture 
  • The Peer-to-peer architecture 
  • The Hybrid architecture

The Client-server Architecture

On a network built using the client-server architecture, the devices communicate to other devices through a central computer referred to as a server. A server is a computer with high processing power, which provides services to other computers on the network. A client is a computer that accesses resources available on the network and those offered by a server. A server is connected to multiple client nodes. The client nodes may have relatively low or no processing capabilities of their own. The client computers send requests to the server for processing information.


The Peer-to-peer Architecture
On a network built using the peer-to-peer architecture, no specific distinction exists between a client and a server computer. In other words, any node can provide a service as well as send a request for a service from another node on the network. The peer-to-peer network architecture allows sharing of resources, data, and users. Each node on the network can have full control over the network resources. However, each user can only access resources for which access privileges have been assigned to the user. Peer-to-peer networks are also referred to as workgroups or P2P networks. 

The Hybrid architecture
A hybrid, in general, is a composition of different types of elements. In computer networks, the hybrid network architecture is not a basic architecture. However, it is a combination of the two basic network architectures, peer- to-peer and client-server. 

NETWORK

NETWORK

A network is a group of computers and other devices, such as a Personal Digital Assistant (PDA) or a printer, connected together with a medium, such as a cable. A network can be created to enable the devices communicate or share resources, such as a file or a printer. A network provides various features, such as:


Data sharing : You can access or share data stored on computers over a network spread across geographical locations.
 Resource sharing : You can share hardware peripheral devices, such as printers and scanners, over the network rather than investing in individual resources for each computer.

. Based on the size and coverage area, networks are categorized into following types:


  • Personal Area Networks (PANs)
  •  Local Area Networks (LANs) 
  • Metropolitan Area Networks (MANs) 
  • Wide Area Networks (WANs)
A PAN is a small network established for communication between different devices, such as laptops, computers, mobiles, and PDAs. The network extends to a range of 10 meters. The following figure shows a PAN.


A LAN connects computers in a room, the floors of a building, or a campus to share resources and exchange information extending up to a few kilometers. For example, when computers used at your home are connected together and share a printer, it forms a small LAN.The following figure shows a LAN.






















MANs are relatively larger than LANs and extend across a city or a metropolitan. This is how they derive their name. A MAN is created by two or more LANs located at different locations in a city. For example, when the network of computers at different colleges of a university is connected together, it forms a MAN. The following figure shows a MAN.





WAN provides network connectivity spanning across large geographical areas, such as across states, countries, or the globe. A WAN may consist of two or more LANs and/or MANs. One of the most prominent examples of existing WANs is the Internet. The following figure shows a WAN that connects different large networks together.






Wednesday, July 29, 2015

javascript

<!DOCTYPE HTML>
<HTML>
 <BODY>
<SCRIPT type="text/javascript">
var day="3";
switch(day)
 {
case "1":
alert("Day is Monday");
 break;
case "2":
alert("Day is Tuesday");
break;
 case "3":
alert("Day is Wednesday");
break;
case "4":
 alert("Day is Thursday");
break;
case "5": alert("Day is Friday");
 break;
case "6": alert("Day is Saturday");
break;
case "7": alert("Day is Sunday");
 break;
default: alert("Not a valid number");
break;
 }
</SCRIPT>
 </BODY>
 </HTML> 

LOGIN PAGE (form class)

LOGIN PAGE



<html>
<HEAD>
<TITLE>LOGIN</TITLE>
</HEAD>
<body>
<center>
<form target="_self">
FIRST NAME:
<INPUT type="text" name="fname" size="20" maxlength="20" pattern="{A-z}" placeholder="Type your first name">
<br>
<br>
LAST NAME:
<INPUT type="text" name="Lname" size="20" maxlength="20">
<BR>
<BR>
GENDER:
<INPUT type="radio" name="gender" checked> MALE<INPUT type="radio" name="gender"> FEMALE
<BR>
<BR>
USER ID:
<INPUT TYPE="EMAIL" name="email_id" multiple>
<br>
<br>

<INPUT type="tel" name="usrtel">
<br>
<br>
<BUTTON type="reset">Reset</ BUTTON>
<BUTTON type="SUBMIT">SUBMIT</ BUTTON>
</form>
</center>
</body>
</html>            

javascript

Tuesday, July 28, 2015

HTML Links


HTML Links

HTML links are defined with the <a> tag:
<a href="http://alltopicstudy.blogspot.in">this is a link</a>

HTML Versions,HEADING,PARAGRAPHS

HTML Versions

Since the early days of the web, there have been many versions of HTML:

VersionYear
HTML       1991
HTML 2.01995
HTML 3.21997
HTML 4.011999
XHTML2000
HTML52014



HTML Headings

HTML headings are defined with the <h1> to <h6> tags:
<h1>hii,welcome html class</h1>
<h2>hii,welcome html class</h2>
<h3>hii,welcome html class</h3>
<h4>hii,welcome html class</h4>
<h5>hii,welcome html class</h5>
<h6>hii,welcome html class</h6>

                 

HTML Paragraphs

HTML paragraphs are defined with the <p> tag:
<P>hii,welcome html class</P>

HTML FRIST CLASS

HTML

HTML is a markup language for describing web documents (web pages).

  • HTML stands for Hyper Text Markup Language
  • A markup language is a set of markup tags
  • HTML documents are described by HTML tags
  • Each HTML tag describes different document content
<!DOCTYPE html>
<html>
<head>
<title>HOME</title>
</head>
<body>

<h1>hellooo</h1>
<p>This is a paragraph.</p>

</body>
</html>

window.alertin javascript

Using window.alert()

You can use an alert box to display data:

Example

<!DOCTYPE html>
<html>
<body>

<h1>My First Web Page</h1>
<p>My first paragraph.</p>

<script>
window.alert(5 + 6);
</script>

</body>
</html>

Sunday, July 26, 2015

assignment operators

Assignment Operators 

There are following assignment operators supported by C#: 

=           Simple assignment operator, Assigns values from right side operands to left side operand
             C = A + B assigns value of A + B into C
+=       Add AND assignment operator, It adds right operand to the left operand and assign the result               to left operand   C += A is equivalent to C = C + A
-=       Subtract AND assignment operator, It subtracts right operand from the left operand and assign            the result to left operand  C -= A is equivalent to C = C – A
*=      Multiply AND assignment operator, It multiplies right operand with the left operand and assign            the result to left operand  C *= A is equivalent to C = C * A
/=        Divide AND assignment operator, It divides left operand with the right operand and assign the            result to left operand  C /= A is equivalent to C = C / A
%=      Modulus AND assignment operator, It takes modulus using two operands and assign the                       result to left operand  C %= A is equivalent to C = C % A
<<=     Left shift AND assignment operator C <<= 2 is same as C = C << 2
>>=   Right shift AND assignment operator C >>= 2 is same as C = C >> 2
&=     Bitwise AND assignment operator C &= 2 is same as C = C & 2
^=      bitwise exclusive OR and assignment operator C ^= 2 is same as C = C ^ 2
|=      bitwise inclusive OR and assignment operator C |= 2 is same as C = C | 2

Example 

The following example demonstrates all the assignment operators available in C#:

using System;
namespace OperatorsAppl
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 21;
            int c;
            c = a;
            Console.WriteLine("Line 1 - =  Value of c = {0}", c);
            c += a;
            Console.WriteLine("Line 2 - += Value of c = {0}", c);
            c -= a;
            Console.WriteLine("Line 3 - -=  Value of c = {0}", c);
            c *= a;
            Console.WriteLine("Line 4 - *=  Value of c = {0}", c);
            c /= a; 
            Console.WriteLine("Line 5 - /=  Value of c = {0}", c);  
            c = 200; 
            c %= a; 
            Console.WriteLine("Line 6 - %=  Value of c = {0}", c);  
            c <<= 2; 
            Console.WriteLine("Line 7 - <<=  Value of c = {0}", c);  
            c >>= 2; 
            Console.WriteLine("Line 8 - >>=  Value of c = {0}", c);  
            c &= 2; 
            Console.WriteLine("Line 9 - &=  Value of c = {0}", c);  
            c ^= 2; 
            Console.WriteLine("Line 10 - ^=  Value of c = {0}", c);  
            c |= 2; 
            Console.WriteLine("Line 11 - |=  Value of c = {0}", c); 
            Console.ReadLine(); 
        } 
    } 
}


















Thursday, July 23, 2015

QUES PAPAR

ARRAY CLASS

Properties of the Array Class The following table describes some of the most commonly used properties of the Array class:
1 IsFixedSize
       Gets a value indicating whether the Array has a fixed size.
2 IsReadOnly
          Gets a value indicating whether the Array is read-only.
3 Length
        Gets a 32-bit integer that represents the total number of elements in all the dimensions of the Array.
4 LongLength
     Gets a 64-bit integer that represents the total number of elements in all the dimensions of the Array.
5 Rank
    Gets the rank (number of dimensions) of the Array.
Methods of the Array Class
1.       Clear
Sets a range of elements in the Array to zero, to false, or to null, depending on the element type.
2.Copy
(Array, Array, Int32) Copies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. The length is specified as a 32-bit integer.
3.GetLength
Gets a 32-bit integer that represents the number of elements in the specified dimension of the Array.
4.GetLongLength
 Gets a 64-bit integer that represents the number of elements in the specified dimension of the Array.
5.GetLower
Bound Gets the lower bound of the specified dimension in the Array.
6. Reverse(Array)
 Reverses the sequence of the elements in the entire one-dimensional Array.
7.Sort(Array)

Sorts the elements in an entire one-dimensional Array using the IComparable implementation of each element of the Array.

c# in string

In C#, you can use strings as array of characters. However, more common practice is to use the string keyword to declare a string variable. The string keyword is an alias for theSystem.String class.
Methods of the String Class

1.       public static int Compare( string strA, string strB )
Compares two specified string objects and returns an integer that indicates their relative position in the sort order.
2.        public static string Concat( string str0, string str1 )= Concatenates two string objects.
3.       public static string Concat( string str0, string str1, string str2 )= Concatenates three string objects.
4.       public static string Concat( string str0, string str1, string str2, string str3 ) =Concatenates four string objects.
5.       public static string Copy( string str ) =Creates a new String object with the same value as the specified string.
6.       public static string Join( string separator, params string[] value ) =Concatenates all the elements of a string array, using the specified separator between each element.
7.       public string Replace( char oldChar, char newChar )= Replaces all occurrences of a specified Unicode character in the current string object with the specified Unicode character and returns the new string.
8.        public string Replace( string oldValue, string newValue )=Replaces all occurrences of a specified string in the current string object with the specified string and returns the new string.

9.       public string Replace( char oldChar, char newChar ) Replaces all occurrences of a specified Unicode character in the current string object with the specified Unicode character and returns the new string.