Showing posts with label Study Material. Show all posts
Showing posts with label Study Material. Show all posts
0

Why C language is important?

Labels: ,

Why is C language called the mother of all languages ?


Introduction

Many computer languages are used for writing computer applications but the computer programming language, C, is the most popular programming language. Most of us must have heard this in schools or colleges that “C language is considered as the mother of all Programming languages”. When students ask why then the professors give a very lame reply that “C language is the the most basic programming language and you will find other languages easy to learn once you understand C.” But is this the only reason why C is called the mother of all programming language or there are some other reasons as well. Let’s check it out.

Why is C middle level language? 

C is called middle-level language because it is actually bind the gap between a machine level language and high-level languages. User can use c language to do System Programming(for writing operating system) as well asApplication Programming (for generate menu driven customer billing system ). That's why it is called middle level language.

Why C language is called C not D or E?

C was the improvement over A and B language. The new language was named "C" because most of its features were derived from "B", which according to Ken Thompson was a stripped-down version of the BCPL programming language. ... From the combination word of “c”, that's why this programming language called c language.


Benefits of C language:-

1. Programs written in C language are efficient, fast and easy to understand.
2. You can easily run a C program on any computer with little change.
3. The most important benefit of C is, it gives faster execution compared to Java. And it also needs less memory for work.

0

Learn JavaScript

Labels: ,

                                     JavaScript



Table of Contents 

1.1 Introduction 
1.2 Functions and Events 
1.3 JavaScript Code 
1.4 JavaScript Variables 
1.5 Arithmetic and Assignment Operators 
1.6 Comparison Operators 
1.7 Logical Operators 
1.8 Conditional Operator 
1.9 Conditional Statements 
1.10 POP UP Box 
1.11 JavaScript Functions 
1.12 JavaScript Loops 
1.13 Events 
1.14 JavaScript - Catching Errors 
1.15 JavaScript Objects Introduction 



                               JavaScript 

1.1 Introduction 

JavaScript was designed to add interactivity to HTML pages. JavaScript is a scripting language. A 
scripting language is a lightweight programming language. JavaScript is usually embedded directly into 
HTML pages. JavaScript is an interpreted language (means that scripts execute without preliminary
compilation). Everyone can use JavaScript without purchasing a license. 

1.1.1 What is JavaScript? 

Java and JavaScript are two completely different languages in both concept and design. Java (developed
by Sun Microsystems) is a powerful and much more complex programming language - in the same 
category as C and C++.

1.1.2 Characteristics of JavaScript 

• JavaScript gives HTML designers a programming tool - HTML authors are normally not
programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone 
can put small "snippets" of code into their HTML pages 
• JavaScript can react to events - A JavaScript can be set to execute when something happens,
like when a page has finished loading or when a user clicks on an HTML element 
• JavaScript can read and write HTML elements - A JavaScript can read and change the content
of an HTML element 
• JavaScript can be used to validate data - A JavaScript can be used to validate form data before
it is submitted to a server. This saves the server from extra processing 
• JavaScript can be used to detect the visitor's browser - A JavaScript can be used to detect the
visitor's browser, and - depending on the browser - load another page specifically designed for 
that browser 
• JavaScript can be used to create cookies - A JavaScript can be used to store and retrieve 
information on the visitor's computer 

1.1.3 JavaScript and ECMAScript Language Standard 

• JavaScript is an implementation of the ECMAScript language standard. ECMA-262 is the official
JavaScript standard. 
• JavaScript was invented by Brendan Eich at Netscape (with Navigator 2.0), and has appeared in
all browsers since 1996. 
• The official standardization was adopted by the ECMA organization (an industry standardization
association) in 1997. 
• The ECMA standard (called ECMAScript-262) was approved as an international ISO (ISO/IEC
16262) standard in 1998. 
• The development is still in progress. 
• The HTML <script> tag is used to insert a JavaScript into an HTML page.

1.1.4 Writing to the HTML Document 

The example below writes a <p> element with current date information to the HTML document:
<html>
<body>
<h1> My First Web Page </h1>
<script type="text/Javascript's">
document.write ("<p>)"+ Date() +("</p>");
</script>
</body>
</html>

Note: Try to avoid using document.write() in real life JavaScript code. The entire HTML page will be overwritten if document.write() is used inside a function, or after the page is loaded.

















0

Learn CSS to help create Website

Labels: ,

                     Cascading Style Sheet


Contents 

1.1 What is CSS? 1 
1.2 CSS Comments 3 
1.3 Three Ways to Insert CSS 4 
1.4 Multiple Style Sheets 5 
1.5 CSS Properties used for Background Effects 6 
1.6 Text 9 
1.7 CSS Font Families 10 
1.8 CSS Links 13 
1.9 CSS Lists 14 
1.10 Table Borders 16 
1.11 The CSS Box Model 18 
1.12 CSS Padding 24


Cascading Style Sheets (CSS) 

1.1 What is CSS? 

• CSS stands for Cascading Style Sheets 
• Styles define how to display HTML elements 
• Styles were added to HTML 4.0 to solve a problem
• External Style Sheets can save a lot of work 
• External Style Sheets are stored in CSS files

1.1.1 Styles 

HTML was never intended to contain tags for formatting a document. HTML was intended to define the 
content of a document, like: 
<h1>This is a heading</h1> 
<p>This is a paragraph.</p> 
When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a 
nightmare for web developers. Development of large web sites, where fonts and color information were added to every single page, became a long and expensive process. 
To solve this problem, the World Wide Web Consortium (W3C) created CSS. In HTML 4.0, all 
formatting could be removed from the HTML document, and stored in a separate CSS file. 
All browsers support CSS today. CSS defines HOW HTML elements are to be displayed. Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!

1.1.2 CSS Syntax 

A CSS rule has two main parts: a selector, and one or more declarations:

The selector is normally the HTML element you want to style. Each declaration consists of a p to property and a value. The property is the style attribute you want to change. Each property has a value.

1.1.3 CSS Example 

A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly 
brackets: 
p {color:red;text-align:center;}

To make the CSS more readable, you can put one declaration on each line, like this: 
color:red; 
text-align:center; 
Example 1 
<html> 
<head> 
<style type="text/css"> 
body {background-color:yellow;} 
h1 {font-size:36pt;} 
h2 {color:blue;} 
p {margin-left:50px;} 
</style> 
</head> 
<body> 
<h1>This header is 36 pt</h1> 
<h2>This header is blue and background is yellow </h2> 
<p>This paragraph has a left margin of 50 pixels</p> 
</body> 
</html> 
Output:



1.2 CSS Comments 

Comments are used to explain your code, and may help you when you edit the source code at a later date. 
Comments are ignored by browsers. A CSS comment begins with "/*", and ends with "*/". 
/*This is a comment*/ 
text-align:center; 
/*This is another comment*/ 
color:black; 
font-family:arial; 
}


1.2.1 The id and class Selectors 

In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called
"id" and "class".


1.2.1.1 The id Selector 

The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute
of the HTML element, and is defined with a "#". The style rule below will be applied to the element with
id="para1": Do not start an ID name with a number. It will not work in Mozilla/Firefox.
#para1
{
text-align:center;
color:red;
}

1.2.1.3 The class Selector 

The class selector is used to specify a style for a group of elements. Unlike the id selector, the class
selector is most often used on several elements. This allows you to set a particular style for many HTML elements with the same class. The class selector uses the HTML class attribute, and is defined with a "." In the example below, all HTML elements with class="center" will be center-aligned: .center {text-align:center;}
You can also specify that only specific HTML elements should be affected by a class. In the example below, all p elements with class="center" will be center-aligned: Do NOT start a class name with a
number! This is only supported in Internet Explorer.
p.center {text-align:center;}
1.3 Three Ways to Insert CSS
There are three ways of inserting a style sheet:
 External style sheet
 Internal style sheet
 Inline style
1.3.1 External Style Sheet
An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet
using the <link> tag. The <link> tag goes inside the head section:
<head> 
<link rel="stylesheet" type="text/css" href="mystyle.css" /> 
</head>
An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. An example of a style sheet file is shown below:
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
Do not leave spaces between the property value and the unit (such as margin-left:20 px). Correct way:
margin-left:20px

1.3.2 Internal Style Sheet 

An internal style sheet should be used when a single document has a unique style. You define internal
styles in the head section of an HTML page, by using the <style> tag, like this:
<head> 
<style type="text/css"> 
hr {color:sienna;} 
p {margin-left:20px;} 
body {background-image:url("images/back40.gif");} 
</style> 
</head> 

1.3.3 Inline Styles 

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly.
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property.
The example shows how to change the color and the left margin of a paragraph:
<p style="color:sienna;margin-left:20px">This is a paragraph.</p> 

1.4 Multiple Style Sheets 

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.
For example, an external style sheet has these properties for the h3 selector:
h3
{
color:red;
text-align:left;
font-size:8pt;
}
And an internal style sheet has these properties for the h3 selector:
h3
{
text-align:right;
font-size:20pt;
}
If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:
color:red;
text-align:right;
font-size:20pt;
The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet.

1.4.1 Multiple Styles - Cascade into One 

Styles can be specified:
 inside an HTML element
 inside the head section of an HTML page
 in an external CSS file
Even multiple external style sheets can be referenced inside a single HTML document.
Cascading order What style will be used when there is more than one style specified for an HTML element?
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
 Browser default
 External style sheet
 Internal style sheet (in the head section)
 Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).
If the link to the external style sheet is placed after the internal style sheet in HTML <head>, the external style sheet will override the internal style sheet.
1.5 CSS properties used for background effects:
CSS background properties are used to define the background effects of an element.
 background-color
 background-image
 background-repeat
 background-attachment
 background-position
Background Color
The background-color property specifies the background color of an element.
The background color of a page is defined in the body selector:
Example























0

Learn HTML Simple Way

Labels: ,

                          ​HTML


  • Introduction to HTML in English :

HTML is a computer language devised to allow website creation. These websites can then be viewed by anyone else connected to the Internet. It is relatively easy to learn; and quite powerful in what it allows you to create.
 It is constantly undergoing revision and evolution to meet the demands and requirements of  the growing Internet audience under the direction of the » W3C, the organization charged with designing  and maintaining the language. 

1.1 Understanding and using HTML 



HyperText is the method by which you move around on the web — by clicking on special text called

hyperlinks which bring you to the next page. The fact that it is hyper just means it is not linear — i.e. you can go to any place on the Internet whenever you want by clicking on links — there is no set order to do things in. Markup is what HTML tags do to the text inside them. They mark it as a certain type of text (italicized text, for example). 



HTML is a Language, as it has code-words and syntax like any other language. HTML is a language for describing web pages. 

• HTML stands for Hyper Text Markup Language 

• HTML is not a programming language, it is markup language . 

• A markup language is a set of markup tags 

• HTML uses markup tags to describe web pages.
So the HTML teaches you to create your own Website easily.

 1.2   What are HTML Tags? 

 The tags are what separate normal text from HTML code. You might know them as the words between the . They allow all the cool stuff like images and tables and stuff, just by telling your browser what to render on the page. 
 Different tags will perform different functions. The tags themselves don’t appear when you view your page through a browser, but their effects do. The simplest tags do nothing more than apply formatting to some text, like this:   
 <b>These words will be bold<\b>, and these will not.
 In the example above, the tags were wrapped around some text, and their effect will be that the contained text will be bolded when viewed through an ordinary web browser. HTML markup tags are usually called HTML tags 
 • HTML tags are keywords surrounded by angle      brackets like 
 • HTML tags normally come in pairs like and 
 • The first tag in a pair is the start tag; the second tag is the end tag

1.3  Getting started with HTML

HTML is written simply in a plain text editor like Notepad. Advanced developers also use software like Frontpage, Expression Web & Dreamweaver.


1.3.1 Saving HTML Web Page

When you save an HTML file, you can use either the .htm or the .html extension. We use .htm in our 
examples. It is a habit from the past, when the software only allowed three letters in file extensions. With new software it is perfectly safe to use .html.

1.3.2 Understand the HTML Web Page Structure

<html> <body> Hello, Student </body> </html>

The text between <html> and </html> describes the web page. The text between <body> and </body> is the visible page content. This is the common structure of all the HTML Web Pages. Always you have to Start the HTML Page with opening HTML and Body Tags <html> and <body> and after putting all the content you need in the Web Page, You need to close the opened tags by </body> and </html>, in the order they were opened.



1.4 HTML Elements


An HTML element is everything from the start tag to the end tag. <p>This is Some Content.</p> Here everything for start paragraph tag to end tag is the HTML Element. The content between the tags “This is Some Content.” is known as the element content.


1.4.1 HTML Element Syntax

• An HTML element starts with a start tag / opening tag. • An HTML element ends with an end tag / closing tag. • The element content is everything between the start and the end tag. • Some HTML elements have empty content. • Empty elements are closed in the start tag. • Most HTML elements can have attributes.

1.4.2 Nested HTML Elements

The HTML Elements can be nested, that is one element can be inside the other element. <html> <body> <p>Hello World</p> </body> </html> Here there are three elements <html>, <body> and <p>. <p> tag is nested inside <body> which in turn is nested inside <html>. Always remember to put the End Tags after opening the tags.

1.4.3 Heading Tags

There are six levels of headings in HTML specified by <H1>, <H2>, <H3>, <H4>, <H5> and <H6> tags. <h1> defines the largest heading and <h6> defines the smallest heading. <html> <body> <h1>My First Heading.</h1> <h2>My Second Heading.</h2> </body> </html> Output:
HTML headings are defined with the <h1> to <h6> tags. <h1> is the biggest font size and <h6> is the smallest.

1.4.4 Hyper Links Tags

These are the tags that really made web pages unique, by letting a person click on text or an image and go to other webpage. Hyperlink tag is a container tag, which means there must be an initial tag and an ending tag. All the web pages in a website are connected to one another using the Hyperlinks. <html> <body> <a https://simplelearnhtml.blogspot.com/ Home Page </a> </body> </html> Output:

1.4.5 Image Tags

This Tag is used for putting pictures or images on your web page. The images can be of any format that is JPG, GIF, PNG etc. The <img> tag is empty, which means that it contains attributes only and it has no closing tag. <html> <body> <img src="Logo.jpg" width="250" height="100" /> </body> </html>
Output:
Note: The Image Tags contains number of attributes like src that is source of the file, width, height of the image, alt attribute etc.

1.5 HTML Comments

All combinations of text placed within the comment tags will be ignored by the web browser; this includes any HTML tags, scripting language(s), etc. <html> <body> <!-- <h1>My First Heading.</h1> -->
<h2> Akshay Dagle</h2> </body> </html> Output :

Note: First Heading would not be displayed as it is commented. So the browsers just ignore everything inside the comment tag.


1.6 HTML Styling Tags 

You may want to change the way the generated HTML output looks. The best way to do that is with a Cascading Style Sheet (CSS), which modern browsers support. Font family, type size, colors, and other styles can be controlled with CSS for each kind of element. Connect CSS to a Webpage Insert the link of CSS Files into the HTML file. The link is to be put in the <HEAD> element. 

<link rel="stylesheet" href="stylesheet.css" type="text/css"> 

The above tag links the CSS file named “stylesheet.css” to the current Web page.


1.11 HTML Table Tags

‘table’ Tag The <table> tag defines an HTML table. A simple HTML table consists of the table element and one or more ‘tr’, ‘th’, and ‘td’ elements. The ‘tr’ element defines a table row, the ‘th’ element defines a table header, and the ‘td’ element defines a table cell. <html> <body>
<table class="table"> <tr> <th> Name </th> <th> Email </th> <th> Remark </th> </tr> <tr> <td> Akshay </td> <td> akshay@gmail.com </td> <td> Pass </td> </tr> <tr> <td> Anushka </td> <td> akshay@gmail.com </td> <td> fail </td> </tr> <tr> <td> Shahrukh</td> <td> akshay@gmail.com </td> <td> Pursing </td> </tr> </table> </body> </html>
Output:

Note: <table> tag is used to start drawing the table <th> is used to define table header <td> is used to define the table cell