0% found this document useful (0 votes)
71 views78 pages

Adi MPS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
71 views78 pages

Adi MPS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 78
PRACTICAL FILE FOR FOC, C, HTML BCA FIRST YEAR ( SESSION: 2022 - 2023 ) SUBMITTED BY: SUBMITTED TO: VISHWAS SAXENA MR. VIKAS CHANDRA SHARMA (DEAN ACADEMICS) MR. LALIT UPADHYAY MR. VARUN MODI /Dr. MPS Group Of Institutions College Of Business Studies NAAC ACCREDITED, UGC RECOGNIZED & AICTE APPROVED NORTH INDIA'S LEADING ONLINE & OFFLINE EDUCATIONAL INSTITUTE Delhi Highway, Near Naveen Sabji Mandi, Sikandra, Agra, Uttar Pradesh, 282007 @ scanned with OKEN Scanner TABLE OF CONTENTS « Largest Number among three given numbers « Whether the number is even or odd ¢ Prime Numbers 1 ton ¢ Factorial of a given number e Search Element in an array ¢ Addition of Two Matrices e Generate Fibonacci Series using Function e Swap Two Numbers ¢ Use of Structure e Heading and Paragraphs in HTML ¢ Ordered an Unordered List + Hyperlink e HTML Forms e CSS with HTML e Images and Tables « Mail Merge «¢ DOS Commands @ scanned with OKEN Scanner Largest Number among three given numbers [A]*Algorithm Step 1: Start Step 2: Input a,b,c Step 3: If a>b Step 4: If a>c Step 5: If b>c Step 6: Output “a is the largest number” Step 7: Output “b is the largest number” Step 8: Output “c is the largest number" @ scanned with OKEN Scanner Largest number among three given Numbers [B]*Flowchart : . start») 7 Input num’, num ‘and nus Print qumt @ scanned with OKEN Scanner [C] *Program: Carsten ears main() { CP Peed ruled Glee aur te Retna CC TO) if (a >= b && a >= c) esl Cae ee Cs ) Peeper an Psen ac @ scanned with OKEN Scanner [D]*Output: 8 9 Poe a ee ea on es tee e COS ore Enter three different numbers: 25 35 45 Peers & Scanned with OKEN Scanner Whether the number is even or d A]*Algorithm: Step1: Start Step2: Take integer variable A Step3: Assign value to the variable Step4: Perform A modulo 2 and check result if output is 0. Step5: If true print A is even Step 6: If false print A is odd Step 7: Stop. @ scanned with OKEN Scanner Whether the number is even or odd [B]*Flowchart : Vv Enter a Number It Number%2==0 No _o Print Even Print Odd @ scanned with OKEN Scanner Teper main() { @ scanned with OKEN Scanner Prime numbers 1 ton (A]* Algorithm: Step1: START Step2: Take integer variable A Step3: Divide the variable A with (A-1 to 2) Step4: If A is divisible by any value (A-1 to 2) it is not prime. Step5: Else it is prime. Step6: STOP @ scanned with OKEN Scanner Prime numbers 1 to n [B]* Flow chart: @ scanned with OKEN Scanner Prime number 1 to n r Cr a Pete me ay Scanned with OKEN Scanner Prime numbers 1 D]*Output: & Scanned with OKEN Scanner Factorial of a given number [A]*Algorithm Step 1: Start Step 2: Read n Step 3: Initialize counter variable i to 1 and fact to 1 Step 4: If i<=n go to step 5 otherwise goto step 7 Step 5: Calculate fact = fact * i Step 6: Increment counter variable i and goto step 4 Step 7: Write fact Step 8: Stop @ scanned with OKEN Scanner Factorial of a given number [B]*Flowchart : i | anne | @ scanned with OKEN Scanner Factorial of a given number [C]*Program : aI suo ct Cee Pole: ae) Cree ce (Cea) eG RCs OM ae st et ass ae) printf("Factorial of 4d = %llu", n, fact) OE Scanned with OKEN Scanner Factorial of a given number [D]* Output : Enter an integer: 10 FAC eC) @ scanned with OKEN Scanner Search Element in an Array A]*Algorithm: Step 01: Start Step 02: [Initialize counter variable. ] Set i=0 Step 03: Repeat Step 04 and 05 fori=0 to i to
tags. hl is the highest level or the main heading, while h6 is the least important. The text inside the heading tags

TEXT

shows on the browser. The size of the text depends on the heading tag. HTML Headings Syntax:

TEXT

Output: Dy Hesaing Syntax x|+ © O file | Cy/usersy. TEXT Explanation: - : It is the start tag for the H1 heading. - TEXT: This text will appear as the main heading on a visitor’s screen. @ scanned with OKEN Scanner . : This is the closing tag for the H1 heading. Why are HTML Headings are Important? Headings in HTML are helpful for both search engines and site visitors. Here are the benefits: - Search Engines: HTML headings help search engines understand and index the structure of a web page. The

...

tag is for main headings. It is followed by

through

tags that denote subheadings. « Site Visitors: They also help site visitors quickly scan and understand a page. Proper headings on a web page help visitors determine if the content is relevant to them. HTML Heading Tags The following are the six HTML tags for different heading sizes. Heading 1
- (Most Important)

Heading 2

Heading 3

Heading 4

Heading 5
@ scanned with OKEN Scanner
Heading 6
- (Least Important) Here is a simple example in HTML to display the H1 through H6 headings on a web page: Heading in HTML

This is Heading

This is Heading

This is Heading

This Heading This is Heading
This Heading @ scanned with OKEN Scanner Dy Heading in HTML x |e oO File | C/Users/... This is Heading 1 This is Heading 2 This is Heading 3 This is Heading 4 This is Heading § This Heading 6 What is an HTML Paragraph? Paragraphs tags or

tags in HTML help us create paragraphs on a web page. On web browsers, paragraphs display as blocks of text separated from adjacent blocks by blank lines, white spaces, or first-line indentation. ‘You can use a

tag followed by the content you want to display in your paragraph and a

. Whenever the web browser comes across a

tag, it starts its contents on a new line. HTML Paragraph Syntax: @ scanned with OKEN Scanner

Paragraph Content

Output: Paragraph in HTML xt © O File | Cyusers/.. + Paragraph Content Explanation: «

: Start tag for the paragraph. . Paragraph Content: The text will appear as a paragraph on a visitor’s screen. .

: It is the closing tag for the paragraph. Why are HTML Paragraph Tags Important? HTML paragraphs help us in multiple ways, such as: They make a web page more readable by giving it a structural view. . Paragraphs can consist of different types of related content, such as text, images, forms, and more. Here is a simple example in HTML to display different paragraphs on a web page: @ scanned with OKEN Scanner Paragraph in HTML

This is paragraph 2. This is paragraph 2. This is paragraph 2. This is paragraph 2. This is paragraph 2. This is paragraph 2. this iS Pparagrapa 2 This is paragraph 2. This is paragraph 2. This is paragraph 2. This is paragraph 2.

This is paragraph 3. This is paragraph 3. This is paragraph @ scanned with OKEN Scanner 3. This is paragraph 3. paragraph 3. This This is paragraph paragraph 3. This This is paragraph paragraph 3.

is This is paragraph 3. Th as paragraph 3. This = @ scanned with OKEN Scanner Ordered and Unordered List + Hyperlink Links are found in nearly all web pages. Links allow users to click their way from page to page. HTML Links - Hyperlinks HTML Lists HTML lists allow web developers to group a set of related items in lists. Example An unordered HTML list: + Item + Item - Item + Item An ordered HTML list: 1.First item 2.Second item 3.Third item 4.Fourth item @ scanned with OKEN Scanner Unordered HTML List An unordered list starts with the
    tag. Each list item starts with the
  • tag. The list items will be marked with bullets (small black circles) by default: Example
    • Ccoffee
    • Tea
    • Milk
    HTML Links HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand. HTML Links - Syntax @ scanned with OKEN Scanner The HTML tag defines a hyperlink. It has the following syntax: Link text The most important attribute of the element is the href attribute, which indicates the link's destination. The link text is the part that will be visible to the reader. Clicking on the link text, will send the reader to the specified URL address. Example This example shows how to create a link to W3Schools.com: Visit W3Schools.com! By default, links will appear as follows in all browsers: + An unvisited link is underlined and blue + A visited link is underlined and purple + An active link is underlined and red HTML Links - The target Attribute @ scanned with OKEN Scanner By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link. The target attribute specifies where to open the linked document. The target attribute can have one of the following values: + _self - Default. Opens the document in the same window/tab as it was clicked _blank - Opens the document in a new window or tab _parent - Opens the document in the parent frame _top - Opens the document in the full body of the window Example Use target="_blank" to open the linked document in a new browser window or tab: Visit W3Schools! Absolute URLs vs. Relative URLs Both examples above are using an absolute URL (a full web address) in the href attribute. @ scanned with OKEN Scanner A local link (a link to a page within the same website) is specified with a relative URL (without the "https://www" part): Example

    Absolute URLs

    "https: //www.w3.org/">W3C

    https://www.google.com/">GoogleRelative URLs

HTML Images

CSS Tutorial

HTML Links - Use an Image as a Link To use an image as a link, just put the tag inside the tag: Example HTML

tutorial @ scanned with OKEN Scanner Link to an Email Address Use mailto: inside the href attribute to create a link that opens the user's email program (to let them send a new email): Example Send email Button as a Link To use an HTML button as a link, you have to add some JavaScript code. JavaScript allows you to specify what happens at certain events, such as a click of a button: Example HTML Links @ scanned with OKEN Scanner Links are found in nearly all web pages. Links allow users to click their way from page to page. HTML Links - Hyperlinks HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand. HTML Links - Syntax The HTML tag defines a hyperlink. It has the following syntax: Link text The most important attribute of the element is the href attribute, which indicates the link's destination. The link text is the part that will be visible to the reader. Clicking on the link text, will send the reader to the specified URL address. @ scanned with OKEN Scanner Example This example shows how to create a link to W3Schools.com: Visit W3Schools.com! By default, links will appear as follows in all browsers: + An unvisited link is underlined and blue + Avisited link is underlined and purple - An active link is underlined and red HTML Links - The target Attribute By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link. The target attribute specifies where to open the linked document. The target attribute can have one of the following values: + _self - Default. Opens the document in the same window/tab as it was clicked @ scanned with OKEN Scanner + _blank - Opens the document in a new window or tab _parent - Opens the document in the parent frame _top - Opens the document in the full body of the window Example Use target="_blank" to open the linked document in a new browser window or tab: Visit W3Schools! Absolute URLs vs. Relative URLs Both examples above are using an absolute URL (a full web address) in the href attribute. A local link (a link to a page within the same website) is specified with a relative URL (without the "https://www" part): Example

Absolute URLs

W3C

Google

Relative URLs

@ scanned with OKEN Scanner

HTML Images

CSS Tutorial

HTML Links - Use an Image as a Link To use an image as a link, just put the tag inside the tag: Example HTML

tutorial Link to an Email Address Use mailto: inside the href attribute to create a link that opens the user's email program (to let them send a new email): Example @ scanned with OKEN Scanner Send email Button as a Link To use an HTML button as a link, you have to add some JavaScript code. JavaScript allows you to specify what happens at certain events, such as a click of a button: Example Visit our HTML Tutorial Link Titles @ scanned with OKEN Scanner The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element. Example Visit our HTML Tutorial Ordered HTML List An ordered list starts with the
    tag. Each list item starts with the
  1. tag. The list items will be marked with numbers by default: Example
    1. Coffee
    2. Tea
    @ scanned with OKEN Scanner HTML Description Lists HTML also supports description lists. A description list is a list of terms, with a description of each term. The
    tag defines the description list, the
    tag defines the term (name), and the
    tag describes each term: Example
    Coffee
    - black hot drink
    Milk
    - white cold drink
    HTML List Tags Tag Description Defines an unordered list Defines an ordered list @ scanned with OKEN Scanner Defines a list item Defines a description list Defines a term in a description list Describes the term in a description list @ scanned with OKEN Scanner HTML Forms An HTML form is used to collect user input. The user input is most often sent to a server for processing. Example First name: [=e Last name? [bee son | The
    Element The HTML element is used to create an HTML form for user input: form elements
    The
    element is a container for different types of input elements, such as: text fields, checkboxes, radio buttons, submit buttons, etc. @ scanned with OKEN Scanner All the different form elements are covered in this chapter: The Element. The HTML element is the most used form element. An element can be displayed in many ways, depending on the type attribute. Here are some examples: Type Description Displays a single-line text input ffelc —_ Displays a radio button (for selecfing choices) many choices) Displays a submit button (for sulmit @ scanned with OKEN Scanner Displays a clickable button All the different input types are covered in this chapter: Text Fields The defines a single-line input field for text input. Example A form with input fields for text:


    This is how the HTML code above will be displayed in a browser: First name: — @ scanned with OKEN Scanner This example will not submit the value of the "First name" input field:


    @ scanned with OKEN Scanner Last name: I Note: The form itself is not visible. Also note that the default width of an input field is 20 characters. The

You might also like