Study Anytime Any Where We Will Open The Knowledge For You Anish Sir 24x7 Learning solution It Is Time to join JOB
09 December 2019

Study Anytime Any Where

09 December 2019

We Will Open The Knowledge For You

09 December 2019

Anish Sir 24x7 Learning solution

09 December 2019

It Is Time to join JOB

C Programming

C++ Programming

JAVA Programming

Android Language

Android-logo.png

.Net Programming

net-logo-b55c217213ae49991589ed43d7ed58a7.png

c# Programming

photo_1389636992_quiz_image_temp.png

Asp .Net

asplogo-square.png

PHP Programming

58481791cef1014c0b5e4994.png

Search Your Topic

config
Anish Sir

Anish Sir

"I am delighted once again to pen the welcome note to the Tosh!Yas Technologies ."

 Call +91 74 88 34 7779  | Email : anishsingh@live.com

Website URL: http://toshiyas.in
Tuesday, 06 February 2018 05:14

Introduction to Computer

What is Computer : Computer is an electronic device that is designed to work with Information. The term computer is derived from the Latin termcomputare’, this means to calculate or programmable machineComputer can not do anything without a Program. It represents the decimal numbers through a string of binary digits. The Word 'Computer' usually refers to the Center Processor Unit plus Internal memory.

Charles Babbage is called the "Grand Father" of the computer. The First mechanical computer designed by Charles Babbage was called Analytical Engine. It uses read-only memory in the form of punch cards.

Computer is an advanced electronic device that takes raw data as input from the user and processes these data under the control of set of instructions (called program) and gives the result (output) and saves output for the future use. It can process both numerical and non-numerical (arithmetic and logical) calculations.

Computer

Digital Computer Definition

The basic components of a modern digital computer are: Input Device, Output Device, Central Processor Unit (CPU), mass storage device and memory. A Typical modern computer uses LSI Chips.  Four Functions about computer are:

 

Input (Data):

Input is the raw information entered into a computer from the input devices. It is the collection of letters, numbers, images etc. 

Process:  

Process is the operation of data as per given instruction. It is totally internal process of the computer system.

Output:

Output is the processed data given by computer after data processing. Output is also called as Result. We can save these results in the storage devices for the future use.

Computer Classification: By Size and Power

Computers differ based on their data processing abilities. They are classified according to purpose, data handling and functionality.

According to functionality, computers are classified as: 

Analog Computer: A computer that represents numbers by some continuously variable physical quantity, whose variations mimic the properties of some system being modeled.

Personal computer: personal computer is a computer small and low costThe term"personal computer" is used to describe desktop computers (desktops).

Workstation: A terminal or desktop computer in a network. In this context, workstation is just a generic term for a user's machine (client machine) in contrast to a "server" or "mainframe."

Minicomputer: minicomputer isn't very mini. At least, not in the way most of us think of mini. You know how big your personal computer is and its related family.

Mainframe: It refers to the kind of large computer that runs an entire corporation.

Supercomputer: It is the biggest, fastest, and most expensive computers on earth.

Microcomputer: Your personal computer is a microcomputer.

Tuesday, 06 February 2018 04:55

Computer Fundamental

Friday, 02 February 2018 05:04

HTML Tables

Using Tables

  • A table is defined using the <table> element, and contains a number of table cells ( <td>, for “table data” ) which are organized into table rows ( <tr>). The markup (HTML code) for a table is always based on rows, never columns.
  • Table cells which act as column headers or row headers should use the <th> (table header) element.
  • Table cells can be merged using the colspan and rowspan attributes.
  • Tables can be broken into sections using the following elements:
    • <thead> — Table header
    • <tbody> — Table body
    • <tfoot> — Table footer
  • A caption can be added to a table using the <caption> element.
  • You can use <col> and <colgroup> to define table columns for styling. However, there are a number of limitations with this practice.

Table Code Sample: Simple Table

<table>
 <tr>
  <th>Name</th>
  <th>Favorite Color</th>
 </tr>
 <tr>
  <td>Bob</td>
  <td>Yellow</td>
 </tr>
 <tr>
  <td>Michelle</td>
  <td>Purple</td>
 </tr>
</table>
Name Favorite Color
Bob Yellow
Michelle Purple

Table Code Sample: Complex Table

<table>
 <caption>A complex table</caption>
 <thead>
  <tr>
   <th colspan="3">Invoice #123456789</th>
   <th>14 January 2025
  </tr>
  <tr>
   <td colspan="2">
    <strong>Pay to:</strong><br>
    Acme Billing Co.<br>
    123 Main St.<br>
    Cityville, NA 12345
   </td>
   <td colspan="2">
    <strong>Customer:</strong><br>
    John Smith<br>
    321 Willow Way<br>
    Southeast Northwestershire, MA 54321
   </td>
  </tr>
 </thead>
 <tbody>
  <tr>
   <th>Name / Description</th>
   <th>Qty.</th>
   <th>@</th>
   <th>Cost</th>
  </tr>
  <tr>
   <td>Paperclips</td>
   <td>1000</td>
   <td>0.01</td>
   <td>10.00</td>
  </tr>
  <tr>
   <td>Staples (box)</td>
   <td>100</td>
   <td>1.00</td>
   <td>100.00</td>
  </tr>
 </tbody>
 <tfoot>
  <tr>
   <th colspan="3">Subtotal</th>
   <td> 110.00</td>
  </tr>
  <tr>
   <th colspan="2">Tax</th>
   <td> 8% </td>
   <td>8.80</td>
  </tr>
  <tr>
   <th colspan="3">Grand Total</th>
   <td>$ 118.80</td>
  </tr>
 </tfoot>
</table>
A complex table
Invoice #123456789 14 January 2025
Pay to:
Acme Billing Co.
123 Main St.
Cityville, NA 12345
Customer:
John Smith
321 Willow Way
Southeast Northwestershire, MA 54321
Name / Description Qty. @ Cost
Paperclips 1000 0.01 10.00
Staples (box) 100 1.00 100.00
Subtotal 110.00
Tax 8% 8.80
Grand Total $ 118.80

About Table-Based Layout

It was common in the early days of the web to use tables as a layout device. Before the advent of modern standards-based browsers, this was the easiest way to make sure that page elements were arranged properly on the screen.

This design pattern is now considered very bad. It is bad for the user experience, bad for SEO, and bad for developers who have to maintain pages.

However, that doesn’t mean you should avoid tables — tables should be used whenever you need to present information in a tabular format.

 




Friday, 02 February 2018 04:37

HTML

Introduction - HTML

HTMLor Hypertext Markup Language is the standard markup language

 (A (document) markup language is a modern system for annotating a document in a way that is syntactically distinguishable from the text.)

 Used to create web pages. It is written in the form of HTML elements consisting of tags enclosed in angle brackets (like <html>). HTML tags most commonly come in pairs like <h1> and </h1>, although some tags represent empty elements and so are unpaired, for example <img>. The first tag in a pair is the start tag, and the second tag is the end tag (they are also called opening tags and closing tags).

Web browsers can read HTML files and compose them into visible or audible web pages. Browsers do not display the HTML tags and scripts, but use them to interpret the content of the page. HTML describes the structure of a website semantically along with cues for presentation, making it a markup language, rather than a programming language.

HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts written in languages such as JavaScript which affect the behavior of HTML web pages.

Web browsers can also refer to Cascading Style Sheets (CSS) to define the look and layout of text and other material. The World Wide Web Consortium (W3C), maintainer of both the HTML and the CSS standards, encourages the use of CSS over explicit presentational HTML.

 

HTML markup consists of several key components, including tags (and their attributes), character-based data typescharacter references and entity references. Another important component is the document type declaration, which triggers standards mode rendering.

The following is an example of the classic Hello world program, a common test employed for comparing programming languages, scripting languages and markup languages.

 

<!DOCTYPE html>

<html>

  <head>

    <title>This is a title</title>

  </head>

  <body>

    <p>Hello world!</p>

  </body>

 

(The text between <html> and </html> describes the web page, and the text between <body> and </body> is the visible page content. The markup text "<title>This is a title</title>" defines the browser page title.)

This Document Type Declaration is for HTML5. If the <!DOCTYPE html> declaration is not included, various browsers will revert to "quirks mode" for rendering

  • (Incomputing, quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for older browsers, instead of strictly complying with W3C and IETF standards in standards mode.)
  • (TheWorld Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web (abbreviated WWW or W3)
  • TheInternet Engineering Task Force (IETF) develops and promotes voluntary Internet standards, in particular the standards that comprise the Internet protocol suite (TCP/IP). It is an open standards organization, with no formal membership or membership requirements. All participants and managers are volunteers, though their work is usually funded by their employers or sponsors.

A few more elements

<html>

<head>

<title>My website</title>

</head>

<body>

<h1>A Heading</h1>

<p>text, text text, text</p>

<h2>Subhead</h2>

<p>text, text text, text</p>

</body>

</html>

Now what?

Now it is time to learn seven new elements.

In the same way you emphasise the text by putting it between the openning tag <em> and the closing tag </em>, you can give stronger emphasis by using the openning tag <strong> and the closing tag </strong>.

Example 1:

<strong>Stronger emphasis.</strong>

Will look like this in the browser:

Stronger emphasis.

Likewise, you can make your text smaller using small:

Example 2:

<small>This should be in small.</small>

Will look like this in the browser:

This should be in small.

Can I use several elements at the same time?

You can easily use several elements at the same time as long as you avoid overlapping elements. This is best illustrated by an example:

Example 3:

If you want to emphasise small text, it must be done like this:

<em><small>Emphasised small text</small></em>

And NOT like this:

<em><small>Emphasise small text</em></small>

The difference is that in the first example, we closed the tag we first opened last. This way we avoid confusing both ourselves and the browser.

More elements!

As mentioned in Lesson 3 there are elements which are opened and closed in the same tag. These so-called empty elements are not connected to a specific passage in the text but rather are isolated labels. An example of such a tag is <br /> which creates a forced line break:

Example 4:

Some text<br /> and some more text in a new line

Will look like this in the browser:

Some text
and some more text in a new line

Notice that the tag is written as a contraction of an opening and closing tag with an empty space and a forward slash at the end: <br />.

Another element that is opened and closed in the same tag is <hr /> which is used to draw a horizontal line ("hr" stands for "horizontal rule"):

Example 5:

<hr />

Will look like this in the browser:

Examples of elements that needs both an opening tag and a closing tag - as most elements do - is ul, ol and li. These elements are used when you want to make lists.

ul is short for "unordered list" and inserts bullets for each list item. ol is short for "ordered list" and numbers each list item. To make items in the list use the li tag ("list item"). Confused? See the examples:

Example 6:

<ul>

<li>A list item</li>  

<li>Another list item</li>       

</ul>

will look like this in the browser:

  • A list item
  • Another list item

Example 8:

<ol>         

<li>First list item</li> 

<li>Second list item</li>     

 </ol>

will look like this in the browser:

  1. First list item
  2. Second list item

Phew! Is that all?

That is all for now. Again, experiment and make your own pages using some of the seven new elements you learned in this lesson:

<strong>Stronger emphasis</strong>       

<small>Small text</small>       

<br /> Line shift       

<hr /> Horizontal line       

<ul>List</ul>       

<ol>Ordered list</ol>     

<li>List item</li>

What is an attribute?

As you probably remember, elements give structure to a HTML document and tells the browser how you want your website to be presented (for example, <br /> informs the browser to make a line break). In some elements you can add more information. Such additional information is called an attribute.

Example 1:

<h2 style="background-color:#ff0000;">My friendship with HTML</h2>

Attributes are always written within a start tag and are followed by an equals sign and the attribute details written between inverted commas. The semicolon after the attribute is for separating different style commands. We will get back to that later.

What is the catch?

There are many different attributes. The first one you will learn is style. With the style attribute you can add layout to your website. For instance a background colour:

Example 2:

<html>                    

<head>         

</head>          

<body style="background-color:#ff0000;">         

</body>        

</html>

will show a completely red page in the browser - go ahead and see for yourself. We will explain in greater detail how the colour system works in a few moments.

Note that some tags and attributes use US spelling i.e. color instead of colour. It is important that you are careful to use the same spelling as we use in the examples in this tutorial - otherwise, browsers will not be able to understand your codes. Also, don't forget to always close the inverted commas (quotation marks) after an attribute.

How did the page become red?

In the above example, we asked for the background colour with the code "#ff0000". This is the colour code for red using so called hexadecimal numbers (HEX). Each colour has its own hexadecimal number. Here are some examples:

White: #ffffff
Black: #000000 (zeros)
Red: #ff0000
Blue: #0000ff
Green: #00ff00
Yellow: #ffff00

A hexadecimal colour code consists of # and six digits or letters. There are more than 1000 HEX codes and it is not easy to figure out which HEX code is tied to a specific colour. To make it easier we have made a chart of the 216 most commonly used colours: 216 Web Safe Colour Chart.

You can also use the English name for the most common colours (white, black, red, blue, green and yellow).

Example 3:

<body style="background-color: red;">

Links

What do I need to make a link?

To make links, you use what you always use when coding HTML: an element. A simple element with one attribute and you will be able to link to anything and everything. Here is an example of what a link to HTML.net could look like:

Example 1:

<a href="http://www.toshiyas.in/">Here is a link to Toshiyas</a>

Would look like this in the browser:

Here is a link to Toshiyas

What about links between my own pages?

If you want to make a link between pages on the same website, you do not need to spell out the entire address (URL) for the document. For example, if you have made two pages (let us call them page1.htm and page2.htm) and saved them in the same folder you can make a link from one page to the other by only typing the name of the file in the link. Under such circumstances a link from page1.htm to page2.htm could look like this:

Example 2:

<a href="/page2.htm">Click here to go to page 2</a>

If page 2 were placed in a subfolder (named "subfolder"), the link could look like this:

Example 3:

<a href="/subfolder/page2.htm">Click here to go to page 2</a>

The other way around, a link from page 2 (in the subfolder) to page 1 would look like this:

Example 4:

<a href="/../page1.htm">A link to page 1</a>

"../" points to the folder one level up from position of the file from which the link is made. Following the same system, you can also point two (or more) folders up by writing "../../".

Did you understand the system? Alternatively, you can always type the complete address for the file (URL).

What about internal links within a page?

You can also create internal links within a page - for example a table of contents at the top with links to each chapter below. All you need to use is a very useful attribute called id (identification) and the symbol "#".

Use the id attribute to mark the element to which you want to link. For example:

<h1 id="heading1">heading 1</h1>

You can now create a link to that element by using "#" in the link attribute. The "#" must be followed by the id of the tag you want to link to. For example:

<a href="#heading1">Link to heading 1</a>

All will become clear with an example

Example 5:

<html>                    

<head>         

</head>          

<body>               

<p><a href="#heading1">Link to heading 1</a></p>              

<p><a href="#heading2">Link to heading 2</a></p>               

<h1 id="heading1">heading 1</h1>              

<p>Text text text text</p>               

<h1 id="heading2">heading 2</h1>              

<p>Text text text text</p>                    

</body>        

</html>     

will look like this in the browser (click on the two links):

Link to heading 1

Link to heading 2

Heading 1

Text text text text

Heading 2

Text text text text

(Note: An id attribute must start with a letter)

Example 6:

 <a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.">Send an e-mail to info at toshiyas.in</a>

will look like this in the browser:

Send an e-mail to nobody at toshiyas.in

The only difference between a link to an e-mail and a link to a file is that instead of typing the address of a document, you type mailto:followed by an e-mail address. When the link is clicked, the default e-mail program opens with a new blank message addressed to the specified e-mail address. Please note that this function will only work if there is an e-mail program installed on your computer. Give it a try!

Are there any other attributes I should know of?

To create a link, you always have to use the href attribute. In addition, you can also put a title on your link:

Example 7:

<a href="http://www.toshiyas.in/" title="Visit toshiyas.in and learn HTML">toshiyas.in</a>

Would look like this in the browser:

Toshiyas.in

Images

Example 1:

<img src="/toshiyas.jpg" alt="David" />

All you need do is first tell the browser that you want to insert an image (img) and then where it is located (src, short for "source"). Do you get the picture?

Notice how the img element is opened and closed using the same tag. Like the <br /> tag, it is not tied to a piece of text.

"david.jpg" is the name of the image file you want to insert in your page. ".jpg" is the file type of the image. Just like the extension ".htm" shows that a file is an HTML document, ".jpg" tells the browser that a file is a picture. There are three different types of image file types you can insert into your pages:

  • GIF (Graphics Interchange Format)
  • JPG / JPEG (Joint Photographic Experts Group)
  • PNG (Portable Network Graphics)

GIF images are usually best for graphics and drawings, while JPEG images are usually better for photographs. This is for two reasons: first, GIF images only consist of 256 colours, while JPEG images comprise of millions of colours and second, the GIF format is better at compressing simple images, than the JPEG format which is optimized for more complex images. The better the compression, the smaller the size of the image file, the faster your page will load. As you probably know from your own experience, unnecessarily 'heavy' pages can be extremely annoying for the user.

Traditionally, the GIF and JPEG formats have been the two dominant image types, but lately, the PNG format has become more and more popular (primarily at the expense of the GIF format). The PNG format contains in many ways the best of both the JPEG and GIF format: millions of colours and effective compressing.

Where do I get my images from?

To make your own images, you need an image editing program. An image editing program is one of the most essential tools you need to create beautiful websites.

Unfortunately, no good image editing programs comes with Windows or other operating systems. Thus, you might consider investing in either Paint Shop Pro, PhotoShop or Macromedia Fireworks, which are three of the best image editing programs currently on the market.

However, as we said before, it will not be necessary to buy expensive programs to complete this tutorial. For now, you can download the excellent image editing program Irfan View which is so-called freeware and therefore costs nothing.

Or you can just borrow images from other sites by downloading them. But please be careful not to violate copyrights when downloading pictures. Still, it's useful to know how to download pictures, so here's how you do it:

  1. Right-click on an image on any image on the Internet.
  2. Choose "Save picture as..." in the menu that appears.
  3. Choose a location for the image on your computer and press "Save".

Do this with the image below and save it on your computer at the same location as your HTML documents. (Notice that the logo is saved as a PNG file: logo.png):

Is that all I need to know about images?

There are a few more things you should know about images.

First, you can easily insert pictures located in other folders, or even pictures that are located on other websites:

Example 2:

<img src="/images/logo.png" />

Example 3:

<img src="http://www.toshiyas.in/logo.png" />

Second, images can be links:

Example 4:

<a href="http://www.toshiyas.in">       

<img src="/logo.png" /></a>

Are there any other attributes I should know about?

You always need to use the attribute src, which tells the browser where the image is located. Besides that, there are a number of other attributes which can be useful when inserting images.

The alt attribute is used to give an alternate description of an image if, for some reason, the image is not shown for the user. This is especially important for users with impaired vision, or if the page is loaded very slowly. Therefore, always use the alt attribute:

Example 5:

<img src="/logo.gif" alt="toshiyas logo" />

Some browsers let the text of the alt attribute appear as a small pop-up box when the user places their cursor over the picture. Please note that when using the alt attribute, the aim is to provide an alternative description of the picture. The alt attribute should not be used to create special pop-up messages for the user since then visually impaired users will hear the message without knowing what the picture is.

The title attribute can be used to add information to the image:

Example 6:

<src="logo.gif" title="Learn HTML from toshiyas.in" />

If you, without clicking, place the cursor over the image, you will see the text "Learn HTML from HTML.net" appear as a pop-up box.

Two other important attributes are width and height:

Example 7:

<img src="/logo.png" width="141px" height="32px" />

The width and height attributes can be used to set the height and width of an image. The value that is used to set the width and height is pixels. Pixels are the units of measurement used to measure the resolution of screens. (The most common screen resolution is 1024x768 pixels). Unlike centimetres, pixels are relative units of measurement which depend on the resolution of the screen. To a user with a high screen resolution, 25 pixels may correspond to 1 centimetre, while the same 25 pixel in a low screen resolution may correspond to 1.5 centimetres on the screen.

If you do not set the width and height, the image will be inserted in its actual size. But with width and height you can manipulate the size:

Example 8:

<img src="/logo.gif" width="32px" height="32px" />

Tables

Tables are used when you need to show "tabular data" i.e. information that is logically presented in rows and columns.

Is it difficult?

Building tables in HTML may at first seem complicated but if you keep cool and watch your step, it is actually strictly logical - just like everything else in HTML.

Example 1:

<table>         

<tr>              

<td>Cell 1</td>

<td>Cell 2</td>         

</tr>         

<tr>              

<td>Cell 3</td>              

<td>Cell 4</td>         

</tr>        <

/table>

 

Cell 1

Cell 2

Cell 3

Cell 4

Will look like this in the browser:

What's the difference between <tr> and <td>?

As you will see from the above example, this is probably the most complicated HTML example we have given you so far. Let's break it down and explain the different tags:

3 different elements are used to insert tables:

  • The opening tag <table> and the closing tag </table> starts and ends the table. Logical.
  • <tr> stands for "table row" and starts and ends horizontal rows. Still logical.
  • <td> is short for "table data". This tag starts and ends each cell in the rows of your table. All simple and logical.

Here is what happens in Example 1: the table starts with a <table>, followed by a <tr>, which indicates the beginning of a new row. Two cells are inserted in this row: <td>Cell 1</td> and <td>Cell 2</td>. The row is hereafter closed with a </tr> and a new row <tr> begins immediately after. The new row also contains two cells. The table is closed with </table>.

Just to make it clear: rows are horizontal lines of cells and columns are vertical lines of cells:

Cell 1

Cell 2

Cell 3

Cell 4

 

Cell 1 and Cell 2 form a row. Cell 1 and Cell 3 form a column.

Example 2:

<table>         

<tr>              

<td>Cell 1</td>              

<td>Cell 2</td>              

<td>Cell 3</td>              

<td>Cell 4</td>         

</tr>         

<tr>              

<td>Cell 5</td>              

<td>Cell 6</td>              

<td>Cell 7</td>              

<td>Cell 8</td>         

</tr>         

<tr>              

<td>Cell 9</td>              

<td>Cell 10</td>              

<td>Cell 11</td>              

<td>Cell 12</td>         

</tr>       

</table>       

Will look like this in the browser:

Cell 1

Cell 2

Cell 3

Cell 4

Cell 5

Cell 6

Cell 7

Cell 8

Cell 9

Cell 10

Cell 11

Cell 12

 

Are there any attributes?

Of course there are attributes. For example, the border attribute is used to specify the thickness of the border around your table:

Example 3:

<table border="1">         

<tr>              

<td>Cell 1</td>              

<td>Cell 2</td>         

</tr>         

<tr>              

<td>Cell 3</td>              

<td>Cell 4</td>         

</tr>       

</table>

Will look like this in the browser:

Cell 1

Cell 2

Cell 3

Cell 4

 

Example 4:

<table border="1" width="30%">

This example will be displayed in the browser as a table with the width of 30% of the screen. Try it yourself.

More attributes?

There are lots of attributes for tables. Here are two more:

  • align: specifies the horizontal alignment of the content in the entire table, in a row or in a single cell. For example, left, center or right.
  • valign: specifies the vertical alignment of the content in a cell. For example, top, middle or bottom.

Example 5:

<td align="right" valign="top">Cell 1</td>

More about tables

The title "More about tables" may sound a bit boring. But look at the positive side, when you master tables, there is absolutely nothing about HTML that will knock you out.

What is left then?

The two attributes colspan and rowspan are used when you want to create fancy tables.

Colspan is short for "column span". Colspan is used in the <td> tag to specify how many columns the cell should span:

Example 1:

<table border="1">         

<tr>              

<td colspan="3">Cell 1</td>         

</tr>         

<tr>              

<td>Cell 2</td>              

<td>Cell 3</td>              

<td>Cell 4</td>         

</tr>       

</table>

Will look like this in the browser:

Cell 1

Cell 2

Cell 3

Cell 4

 

By setting colspan to "3", the cell in the first row spans three columns. If we instead had set colspan to "2", the cell would only have spanned two columns and it would have been necessary to insert an additional cell in the first row so that the number of columns will fit in the two rows.

Example 2:

<table border="1">         

<tr>              

<td colspan="2">Cell 1</td>              

<td>Cell 2</td>         

</tr>         

<tr>              

<td>Cell 3</td>              

<td>Cell 4</td>              

<td>Cell 5</td>         

</tr>       

</table>

Will look like this in the browser:

Cell 1

Cell 2

Cell 3

Cell 4

Cell 5

 

What about rowspan?

As you might already have guessed, rowspan specifies how many rows a cell should span over:

Example 3:

<table border="1">         

<tr>              

<td rowspan="3">Cell 1</td>              

<td>Cell 2</td>         

</tr>         

<tr>              

<td>Cell 3</td>         

</tr>         

<tr>              

<td>Cell 4</td>         

</tr>       

</table>

Will look like this in the browser:

Cell 1

Cell 2

Cell 3

Cell 4

 

Tosh!Yas Basic HTML Sample Page

<HEAD>

<TITLE>Tosh!Yas Basic HTML Sample Page</TITLE>

</HEAD>

<BODY BGCOLOR="WHITE">

<CENTER>

<H1>A Simple Sample Web Page</H1>

  <IMG SRC="http://toshiyas.in/images/call.jpg">

  <H4>By Tosh!Yas Information Technology</H4>

<H2>Demonstrating a few HTML features</H2>

</CENTER>

HTML is really a very simple language. It consists of ordinary text, with commands that are enclosed by "<" and ">" characters, or bewteen an "&" and a ";". <P>

 You don't really need to know much HTML to create a page, because you can copy bits of HTML from other pages that do what you want, then change the text!<P>

 This page shows on the left as it appears in your browser, and the corresponding HTML code appears on the right. The HTML commands are linked to explanations of what they do.

 <H3>Line Breaks</H3>

HTML doesn't normally use line breaks for ordinary text. A white space of any size is treated as a single space. This is because the author of the page has no way of knowing the size of the reader's screen, or what size type they will have their browser set for.<P>

If you want to put a line break at a particular place, you can use the "<BR>" command, or, for a paragraph break, the "<P>" command, which will insert a blank line. The heading command ("<4></4>") puts a blank line above and below the heading text.

<H4>Starting and Stopping Commands</H4>

Most HTML commands come in pairs: for example, "<H4>" marks the beginning of a size 4 heading, and "</H4>" marks the end of it. The closing command is always the same as the opening command, except for the addition of the "/".<P>

Modifiers are sometimes included along with the basic command, inside the opening commands < >. The modifier does not need to be repeated in the closing command.

<H1>This is a size "1" heading</H1>

<H2>This is a size "2" heading</H2>

<H3>This is a size "3" heading</H3>

<H4>This is a size "4" heading</H4>

<H5>This is a size "5" heading</H5>

<H6>This is a size "6" heading</H6>

<center>

<H4>Copyright © 2015, by

<A HREF="http://toshiyas.in/index.html">Tosh!Yas</A>

</H4>  

 

Thursday, 21 September 2017 05:56

C -for-Program

Print the first five numbers starting from I together with their squares.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  I;

       Clrscr ( );

       For (i=l; <=5; i++)

       Printf (“\n  Number:  %5d  it’ s  Square:  %5d”, I, i*i);

      getch();

}

OUTPUT:

Number:  1  it’ s  Square:  1

Number:  2  it’ s  Square:  4

Number:  3  it’ s  Square:  9

Number:  4  it’ s  Square:  16

Number:  5  it’ s  Square:  25      

#include<stdio.h>

#include<conio.h>

Valid main ( )

{

        Int  I;

        Clrscr ( ) ;

        For ( i=l; i<=15; i= i+l)

        Printf (“%5d”,i);

        getche ( );

}

OUTPUT:

1 2 3 4 5 6 7 8 9 10 11 12 13 14  15

Write a program to display even numbers from 0 to 14.  Declare the initial counter value before the for loop statement.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

        Int  i=o ;

        Clrscr ( );

        For (i<=15;)

        {

                  Printf (“% 5 d “ , i) ;

                  i+=2;

        }

}

OUTPUT:

O 2 4 6 7 8 10 12 14

Write a program to count numbers between 1 to 100 not divisible by 2, 3, and 5.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

     Int  x, c=0;

     Clrscr ( );

     Printf (“\n  Numbers  from  1  to  100  not  divisible  by  2, 3  &  5 \n \n”);

     For (x=0  ;x<=100 ;x ++)

     {

            If (x%2 !=0   &&  x%3!=0  && x%5!=0)

            {

                Printf (%”%d\t” ,x),

                C++;

            }

     }

     Printf (“\nTotal numbers  :  %d”, c );

}

OUTPUT:

Numbers  from  1  to  100  not  divisible  by 2, 3  &  5

1    7    11    13    17    19    23    29    31    37     37

41   43    47    49    53     59    61    67    71     73

77    79    83    89   91    97

Total  Numbers  :  26

Write a program to display the numbers in increasing and decreasing order using the infinite for loop.    

#include<stdio.h>

#include<conio.h>           

Void main ( )

{

       Int  n, a, b;

       Clrscr ( );

       Printf (“Enter  a  number  :”);

       Scanf (“, &);

       A=b=n;

       Printf (“ (++)  ( - - ) \n”);

       Printf (“============”);

       For (;  ;  (a++, b - - ) )

       {

             Printf (“\n%d\t%d”, a, b);

             If (b==0)

             Break;

       }

}

OUTPUT:

Enter  a  number  :  5

(++)         ( - - )

===========

5    5

6    4

7    3

8    2

9    1

10  0   

create an infinite for loop.  Check each value of the for loop.  If the value is even display it otherwise continue with iterations.  Print Even numbers from 1 to 21.  Use break statement to terminate the program.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  i=l;

       Clrscr ( );

       Printf (“\n \t \t  Table  of  Even  numbers  from  1  to  20”);

       Printf (“\n \t \t  ===== == ==== ======= ==== = == == \n”);

       For (;  ;)

       {

           If (i==21)

           Break;

           else  if (i%2==0)

           {

                 Printf (“%d\t”, i);

                 I++;

                 Continue;

           }

           else

           {

                I++;

                Continue;

           }

    }

    getche ( );

}

OUTPUT:

Table  of  Even  numbers  from  1  to  20

====  ==  ====  =======  ===  =  ==  ==

2  4  6  8  10  12  14  16  18  20   

Calculate the sum of the first five numbers and their squares. Display their results.

Void main ( )

{

        Int  I,  sum=0, sqsum=0;

        Clrscr ( );

        For (i=l; i<-5; ++)

        {

               Sum+-I;

               Sqsum+=i*I;

               Printf (“\n  number:  %5d  it’ s  Square  :  %8d”, I, i*i);

       }

       Printf (“\n===================================”);

       Printf (“\n  The  sum  of  the  five  numbers (1  t0  5)  : -%6d”, sum);

       Printf (“\n  The  sum  of  their  Squares: -%9d”,  sqsum);

       getche ( );

}

OUTPUT:

Number:             1                 it’ s  Square:             1

Number:             2                 it’ s  Square:             4

Number:             3                 it’ s  Square:             9

Number:             4                 it’ s  Square:            16

Number:             5                 it’ s  Square:            25

=========================================

The  sum  of  the  five  numbers (1  t0  5) : -  15

The  sum  of  their  Squares: -  55       

 Write a program to find the number in between 7 and 100 which is exactly divisible by 4 and

If divided by 5 and 6 remainders obtained should be 4.

#include<stdio.h>

#include<conio.h>

#  include  <process . h>

Void main ( )

{

       Int  x;

       Clrscr ( );

       For (x=7;x<100;x++)

       {

              If (x%4==0  &&  x%5==4  &&  x%6==4)

              {

                     Printf (“\n  Number  :  %d”, x);

              }

      }

     getche ( );

}

OUTPUT:

Number  :  64   

Write a program to find the sum of the following series.

/*  1.  1+2+3+ ..n  */

/*  2.  12+22+32+..n2  */

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  sum=0, ssum-0, I, j;

       Clrscr ( );

       Printf (“Enter  Number  :”);

       Scanf (“%d”,  &j);

       Clrscr ( );

       Printf (“  Numbers:”);

       For (i=1; i<=j; i++)

       Printf (“%5d”, i);

       Printf (“\n \nSquares:”);

       For (i=1; i<=j; i++)

       {

            Printf (“%5d”, i*i);

            Sum=sum+I;

            Sum=ssum+i*i;

       }

       Printf (“\n \nSum  of  Numbers  from  1  to  %d  :%d”, j, sum);

       Printf (“\nSum  of  Squares  of  1  to  %d  Numbers  :%d”, j, ssum);

}

OUTPUT:

Enter  Number:  5

Numbers:  1  2  3  4  5

Squares:  1  4  9  16  25

Sum  of  Numbers  from  1  to  5:  15

Sum  of  Squares  of  1  to  5  Numbers:  55 

Write a program to find the perfect squares from 1 to 500.

#include<stdio.h>

#include<conio.h>

# include  <math . h>

Void maid ( )

{

      Int  I, count, x;

      Float  c;

      Clrscr ( );

      Printf (“\n \n”);

      Printf (“  Perfect  squares  from  1  to  500 \n”);

      For (i=1; <=500; i++)

  {

      C=sqrt (i);

       X=floor (c);  /*  For  rounding  up  floor ( )  is  used.  */

       {

              Printf (“\t%5d”, i);

              Coun ++;

      }

  }

  Printf (“\n \n  Total  Perfect  Squares  =5d\n”, conut);

  getch ( );

}

OUTPUT:

1       4      9      16      25   36   49   64   81   121   144

169   196   225    256    289   324    361    400   441

484                             

Total  Perfect  Squares  =  22

Write a program to detect the largest number out of five numbers and display it.

#include<stdio.h>

#include<conio.h>

# include<process . h>

Void main ( )

Exit (0);

{

       Int  a, b, c, e, sum=0, I;

       Clrscr ( );

       Printf (“\nEnter  Five  numbers  :”);

       Scanf (“%d  %d  %d  %d  %d”, &a, &b, &c, &d, &e);

       For (i=sum;  i<=sum; I - -)

       {

             If (i==a  ||  i==b  ||  i==c  ||  i==d  ||  i==e)

             {

                   Printf (“The  Largest  Number  :  %d”, i);

                   Exit (0);

             }

      }

}

OUTPUT:

Enter  Five  number  :  5  2  3  7  3 

The  Largest  Number  :  7        

Write a program to detect the smallest number our of five numbers and display it.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d, e, sum=0, I;

      Clrscr ( );

      Printf (“\nEnter  Five  numbers  :”);

      Scanf (“%d  %d  %d  %d  %d”, &a, &b, &c, &d, &e);

      Sum=a+b+c+d+e;

      For (i=l;  i<=sum; i++)

      {

            If (i==a  ||  i==b  ||  i==c  ||  i==d  ||  i==e)

            {

            Printf (“The  Smallest  Number  :  %d”, i)

            Exit (0);

            }

      }

}

OUTPUT:

Enter  Five  numbers  :  5  2  3  7  3

The Smallest  Number:  2          

Write a program to print the five entered numbers in the ascending order.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d, e, sum-0, I;

      Clrscr ( );

      Printf (“\nEnter  Five  numbers  :”);

      Scanf (“%d  %d  %d  %d  %d” &a, &b, &c, &d, &e);

      Printf (“\n  Numbers  in  ascending  order  :”);

      Sum=a+b+c+d+e;

      For (i=l;  i<=sum; i++)

  {

     If (i==a  ||  i==b  ||  i==c  ||  i==d  ||  i==e)

     {

             Printf (“%3d”, i);

     }

  }

}

OUTPUT:

Enter  Five  numbers  :  5  8  7  4  1

Numbers  in  ascending  order  :  1  4  5  7  8  

Perform multiplication of two integers by using the negative sign.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d=0;

      Clrscr ( );

      Printf (“\n  Enter  two  numbers  :”);

      Scanf (“%d  %d”,  &a, &b);

      For (c=l; c<-b; c++)

      D= (d) – ( - a);

      Printf (“Multiplication  of  %d  *  %d  :%d”, a, b, d);

      getche ( );

}

OUTPUT:

Enter  two  numbers  :  5  5

Multiplication  of  5  *  5  :  25   

 Calculate the sum and average of five subjects.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  a, b, c, d, e, sum=0, I;

      Float  avg;

      Clrscr ( );

      Printf (“\nEnter  The  Marks  of  Five  Subjects”);

      For (i=l; i<=5; i++)

      {

           Printf (“\n [%d]  Student:”, i);

           If (scanf (“%d  %d  %d  %d  %d”, &a, &b, &c, &d, &e) ==5)

           {

                 Sum=a+b+c+d+e;

                 Avg=sum/5;

                 Printf (“\n  Total  Marks  of  Student [%d]  %d”, I, sum);

                 Printf (“\n  Average  Marks  of  Student [%d]  %f\n”, I, avg);

           }

           else

           {

                Clrscr ( );

                Printf (“\n  Type  Mismatcch”);

           }

     }

}

OUTPUT:

Enter  The  Marks  of  Five  Subjects

[1] Student:  58  52  52  56  78

      Total  Marks  of  Student [1]  296

      Average  Marks  of  Student [1]  59.000000

[2] Student:             

Write a program to find perfect cubes up to a given number.

/* 1, 8, 27, 64 are perfect cubes of 1, 2, 3 and 4 */.

#include<stdio.h>

#include<conio.h>

#  include<math . h>

Void main ( )

{

      Int  I,  j,  k;

      Clrscr ( );

      Printf (“Enter  a  Number  :”);

      Scanf (“%d”, &k);

      For (i=l; i<k; i++)

      {

            For (j=l; j<=I; j++)

            {

                 If (i==pow (j,3) )

                 Printf (“\nNumber  :  %d  &   it’ s  Cube  :%d:, j, i);

            }

     }

}

OUTPUT:

Enter  a  Number  :  100

Number  :  1  &  it’ s  Cube  :  1

Number  :  2  &  it’ s  Cube  :  8

Number  :  3  &  it’ s  Cube  :  27

Number  :  4  &  it’ s  Cube  :  64

Write a program to display the stars as shown below.

*

*  *

*  *  *

*  *  *  *

*  *  *  *  *

#include<stdio.h>

#include<conio.h>

Void main ( )

{

       Int  x, I, j;

       Clrscr ( );

       Printf (“How  many  lines  stars  (*)  should  be  printed  ?  :”);

       Scanf (“%d”, &x);

       For (i=l; i<=x; i++)

       {

              For (j=l; j<=I; j++)

              {

                     Printf (“*”);

              }

              Printf (“\n”);

       }

}

OUTPUT:

How  many  lines  stars  (*)  should  be  printed  ?  :  5

*

*  *

*  *  *

*  *  *  *

*  *  *  *  *

Write a program to generate the pattern of numbers as given under.

6  5  4  3  2  1  0 

5  4  3  2  1  0

4  3  2  1  0

3  2  1  0 

2  1  0 

1  0 

0

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  I, c=0;

      Clrscr ( );

      Printf (“Enter  a  Number  :”);

      Scanf (“%d, &i);

      For (;i>=0i - -)

      {

            C=I;

            Printf (“\n”);

            For (;  ;)

            {

                   Printf (“%3d”, c);

                   If (c==0)

                   Break;

                   C- -;

            }

      }

}

OUTPUT:

Enter  a  number:  6

6  5  4  3  2  1  0 

5  4  3  2  1  0

4  3  2  1  0

3  2  1  0 

2  1  0 

1  0 

Write a program to display the series of numbers as given below.

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  I, j, x; 

      Printf (“\nEnter  Value  of  x  :”);

      Scanf (“%d”,&x);

      Clrscr ( );

      For (j=l; j<=x; j++)

      {

             For (i=l; i<=j; i++)

             Printf (“%3d”, i);

             Printf (“\n”);

     }

     Printf (“\n”);

     For (j=x; j>=l; I - -)

     {

            For (i=j; i>=l; I- -)

            Printf (“%3d”, i);

            Printf (“\n”);

     }

OUTPUT:

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1        

Write a program to display the series of numbers as given below.

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1

#include<stdio.h>

#include<conio.h>

Void main ( )

{

     Int  I, j, x;

     Printf (“\nEnter  Value  of  x  :”);

     Scanf (“%d”, &x);

     Clrscr ( );

     For (j-l; j<=x; j++)

     {

           For (i=j; i>=l; I - -)

           {

                 Printf (“%3d”, i);

           }

           Printf (“\n”);

     }

}

OUTPUT:

Enter  Value  of  x  :  4

1

1  2

1  2  3

1  2  3  4 

4  3  2  1

3  2  1

2  1 

1

Write a program to generate the pyramid structure using numerical.

#include<stdio.h>

#include<conio.h>

Void main ( )

{

      Int  k, I, j, x, p=34;

      Printf (“\n  Enter  A  number  :”);

      Scanf (“%d”, &x);

      Clrscr ( );

      For (j=0; j <=x; j++)

      {

             Gotoxy(p, j+l);

             /*  position  cursor  on  screen  (x  cordinate, y  cordinate)  */

            For (i=0 – j; I <=j; i++)

            Printf (“%3d”, abs ( I ) );

            P=p-3;

     }

}

OUTPUT:

Enter  a  number  :  3

            0

        1  0  1

    2  1  0  1  2

3  2  1  0  1  2  3    

 

Tuesday, 19 September 2017 05:11

nested loops in C

C programming allows to use one loop inside another loop. The following section shows a few examples to illustrate the concept.

Syntax

The syntax for a nested for loop statement in C is as follows −

for ( init; condition; increment ) {

   for ( init; condition; increment ) {
      statement(s);
   }
	
   statement(s);
}

The syntax for a nested while loop statement in C programming language is as follows −

while(condition) {

   while(condition) {
      statement(s);
   }
	
   statement(s);
}

The syntax for a nested do...while loop statement in C programming language is as follows −

do {

   statement(s);
	
   do {
      statement(s);
   }while( condition );

}while( condition );

A final note on loop nesting is that you can put any type of loop inside any other type of loop. For example, a 'for' loop can be inside a 'while' loop or vice versa.

Example

The following program uses a nested for loop to find the prime numbers from 2 to 100 −

#include <stdio.h>
 
int main () {

   /* local variable definition */
   int i, j;
   
   for(i = 2; i<100; i++) {

      for(j = 2; j <= (i/j); j++) 
      if(!(i%j)) break; // if factor found, not prime
      if(j > (i/j)) printf("%d is prime", i);
   }
 
   return 0;
}

When the above code is compiled and executed, it produces the following result −

2 is prime
3 is prime
5 is prime
7 is prime
11 is prime
13 is prime
17 is prime
19 is prime
23 is prime
29 is prime
31 is prime
37 is prime
41 is prime
43 is prime
47 is prime
53 is prime
59 is prime
61 is prime
67 is prime
71 is prime
73 is prime
79 is prime
83 is prime
89 is prime
97 is prime
Tuesday, 19 September 2017 05:09

do...while loop in C

Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming checks its condition at the bottom of the loop.

do...while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time.

Syntax

The syntax of a do...while loop in C programming language is −

do {
   statement(s);
} while( condition );

Notice that the conditional expression appears at the end of the loop, so the statement(s) in the loop executes once before the condition is tested.

If the condition is true, the flow of control jumps back up to do, and the statement(s) in the loop executes again. This process repeats until the given condition becomes false.

Flow Diagram

do...while loop in C

Example

#include <stdio.h>
 
int main () {

   /* local variable definition */
   int a = 10;

   /* do loop execution */
   do {
      printf("value of a: %d\n", a);
      a = a + 1;
   }while( a < 20 );
 
   return 0;
}

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
Tuesday, 19 September 2017 05:07

for loop in C

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 programming language is −

for ( init; condition; increment ) {
   statement(s);
}

Here is the flow of control in a 'for' loop −

  • 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.

  • 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 the flow of control jumps to the next statement just after the 'for' loop.

  • 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.

  • 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 condition). After the condition becomes false, the 'for' loop terminates.

Flow Diagram

for loop in C

Example

#include <stdio.h>
 
int main () {

   int a;
	
   /* for loop execution */
   for( a = 10; a < 20; a = a + 1 ){
      printf("value of a: %d\n", a);
   }
 
   return 0;
}

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
Tuesday, 19 September 2017 04:56

while loop in C

while loop in C programming repeatedly executes a target statement as long as a given condition is true.

Syntax

The syntax of a while loop in C programming language 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 nonzero value. The loop iterates while the condition is true.

When the condition becomes false, the program control passes to the line immediately following the loop.

Flow Diagram

while loop in C

Here, the key point to note is that a while loop might not execute at all. When the condition is tested and the result is false, the loop body will be skipped and the first statement after the while loop will be executed.

Example

#include <stdio.h>
 
int main () {

   /* local variable definition */
   int a = 10;

   /* while loop execution */
   while( a < 20 ) {
      printf("value of a: %d\n", a);
      a++;
   }
 
   return 0;
}

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
Tuesday, 19 September 2017 04:11

C-loop

  What is a Loop?

A loop is defined as a block of statements, which are repeatedly executed for a certain number of times.

     The loops are two types.

  • Counter-controlled repetition: This is also called the definite repetition action, because the number of iterations to be performed is defined in advance in the program itself. The steps for performing counter-controlled repetitions are as follows.

Steps in Loop

Loop variable: IT is a variable used in the loop

Initialization: It is the first step in which starting and final values are assigned to the loop variable. Each time the upload value is checked by the loop itself.

Incrimination/discrimination: It is the numerical value added or subtracted to the variable in each round of the loop. The upload value is compared with the final value and if it is found less than the final value the steps in the loop are executed.  

The above steps are implemented in numerous programs in this chapter.

  • Sentinel- controlled repetition: This is also called the indefinite repetition. One cannot estimate how many    iterations are to be performed.  In this type, loop termination happens on the basis of certain conditions using the decision-making statement.

In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number. If it hasn't, the next instruction in the sequence is an instruction to return to the first instruction in the sequence and repeat the sequence. If the condition has been reached, the next instruction "falls through" to the next sequential instruction or branches outside the loop. A loop is a fundamental programming idea that is commonly used in writing programs.

infinite loop (endless loop)

An infinite loop (sometimes called an endless loop ) is a piece of coding that lacks a functional exit so that it repeats indefinitely. In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked, such as whether a counter has reached a prescribed number. If the presence of the specified condition cannot be ascertained, the next instruction in the sequence tells the program to return to the first instruction and repeat the sequence, which typically goes on until the program terminates automatically after a certain duration of time, or the operating system terminates the program with an error.

Usually, an infinite loop results from a programming error - for example, where the conditions for exit are incorrectly written. 

Loop Type & Description

while loop

Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body.

 

for loop

Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.

 

do...while loop

 It is more like 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 other while, for, or do..while loop.

 

Page 3 of 34