Tuesday, 10 September 2024

Write a program to Adition Two number using javascript

<!doctype html>

<html>

<head>

<title>Add Two Numbers</title>

<script>

  var numOne = 10;

  var numTwo = 20;

  var sum = numOne + numTwo;

  document.write("Sum = " + sum);

</script>

</head>

<body>

</body>

</html>

Write Program to Clickable Dropdown menu using html

 <!DOCTYPE html>

<html>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1">

<style>

.dropbtn {

  background-color: #3498DB;

  color: white;

  padding: 16px;

  font-size: 16px;

  border: none;

  cursor: pointer;

}

.dropbtn:hover, .dropbtn:focus {

  background-color: #2980B9;

}


.dropdown {

  position: relative;

  display: inline-block;

}


.dropdown-content {

  display: none;

  position: absolute;

  background-color: #f1f1f1;

  min-width: 160px;

  overflow: auto;

  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);

  z-index: 1;

}


.dropdown-content a {

  color: black;

  padding: 12px 16px;

  text-decoration: none;

  display: block;

}


.dropdown a:hover {background-color: #ddd;}


.show {display: block;}

</style>

</head>

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


<h2>Clickable Dropdown</h2>

<p>Click on the button to open the dropdown menu.</p>


<div class="dropdown">

  <button onclick="myFunction()" class="dropbtn">Dropdown</button>

  <div id="myDropdown" class="dropdown-content">

    <a href="#home">Home</a>

    <a href="#about">About</a>

    <a href="#contact">Contact</a>

  </div>

</div>


<script>

/* When the user clicks on the button, 

toggle between hiding and showing the dropdown content */

function myFunction() {

  document.getElementById("myDropdown").classList.toggle("show");

}


// Close the dropdown if the user clicks outside of it

window.onclick = function(event) {

  if (!event.target.matches('.dropbtn')) {

    var dropdowns = document.getElementsByClassName("dropdown-content");

    var i;

    for (i = 0; i < dropdowns.length; i++) {

      var openDropdown = dropdowns[i];

      if (openDropdown.classList.contains('show')) {

        openDropdown.classList.remove('show');

      }

    }

  }

}

</script>


</body>

</html>

Write a program to Select Option using html

 <!DOCTYPE html>

<html>

<head>

<title>Select Option Program</title>

</head>

<body>

<h1>Select Option Program</h1>

Select Your Language:

<select>

<option>English</option>

<option>Hindi</option>

<option>Marathi</option>

</select><br>

<button>Click Me<button>

</body>

</html>

Write a program Image using html

HTML Images Syntax

The HTML <img> tag is used to embed an image in a web page.

Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space for the referenced image.

The <img> tag is empty, it contains attributes only, and does not have a closing tag.

The <img> tag has two required attributes:

  • src - Specifies the path to the image
  • alt - Specifies an alternate text for the image
Syntax:

<img src="image_name\image_name.image_exetension">

 <!DOCTYPE html>

<html>

<head>

<style>

img {

  width: 100%;

}

</style>

</head>

<body>

<img src="html5.gif" alt="HTML5 Icon" width="128" height="128">

<img src="html5.gif" alt="HTML5 Icon" style="width:128px;height:128px;">

</body>

</html>

The alt Attribute

The required alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

The value of the alt attribute should describe the image:

<img src="image_name\image_name.image_exetension" alt="image_name">

Image Size - Width and Height

You can use the style attribute to specify the width and height of an image.

<img src="image_name\image_name.image_exetension" height="300" width="200">

Width and Height, or Style?

The widthheight, and style attributes are all valid in HTML.

However, we suggest using the style attribute. It prevents styles sheets from changing the size of images:

<!DOCTYPE html>

<html>

<head>

<style>

/* This style sets the width of all images to 100%: */

img {

  width: 100%;

}

</style>

</head>

<body>

<h2>Width/Height Attributes or Style?</h2>

<p>The first image uses the width attribute (set to 128 pixels), but the style in the head section overrides it, and sets the width to 100%.</p>

<img src="html5.gif" alt="HTML5 Icon" width="128" height="128">

<p>The second image uses the style attribute to set the width to 128 pixels, this will not be overridden by the style in the head section:</p>

<img src="html5.gif" alt="HTML5 Icon" style="width:128px;height:128px;">

</body>

</html>

Common Image Formats:

Abbreviation

File Format

File Extension

APNG

Animated Portable Network Graphics

.apng

GIF

Graphics Interchange Format

.gif

ICO

Microsoft Icon

.ico, .cur

JPEG

Joint Photographic Expert Group image

.jpg, .jpeg, .jfif, .pjpeg, .pjp

PNG

Portable Network Graphics

.png

SVG

Scalable Vector Graphics

.svg


Chapter Summary

  • Use the HTML <img> element to define an image
  • Use the HTML src attribute to define the URL of the image
  • Use the HTML alt attribute to define an alternate text for an image, if it cannot be displayed
  • Use the HTML width and height attributes or the CSS width and height properties to define the size of the image
  • Use the CSS float property to let the image float to the left or to the right

Write a program to Select File using html

 <!DOCTYPE html>

<html>

<body>

<h1>Select File</h1>

Select Your File: <input type="file">

</body>

</html>


Write a program to Video Tag using html

 <!DOCTYPE html>

<html>

<body>


<h1>The video element</h1>


<video width="320" height="240" controls>

  <source src="movie.mp4" type="video/mp4">

  <source src="movie.ogg" type="video/ogg">

  Your browser does not support the video tag.

</video>


</body>

</html>


Write a program to Frame


<html>
<head>
   <title>HTML Frames</title>
</head>
<frameset cols="25%,50%,25%">
   <frame name="left" src="/html/top_frame.htm" />
   <frame name="center" src="/html/main_frame.htm" />
   <frame name="right" src="/html/bottom_frame.htm" />
   <noframes>
      <body>
         Your browser does not support frames.
      </body>
   </noframes>
</frameset>
</html>

Friday, 6 September 2024

Write a program to Multiplication in C

 *******Write a program to Multiplication in C *******

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();  //Previous screen clear

int a,b,c;

printf("Enter Two Num:");

scanf("%d %d",&a,&b);

c=a*b;

printf("The Multiplication is %d\n",c);

getch();

*********************************Output *************************************

Enter Two Num: 5 5

The Multiplication is  25


Write a program to Division in C

 *******Write a program to Division in C *******

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();  //Previous screen clear

int a,b,c;

printf("Enter Two Num:");

scanf("%d %d",&a,&b);

c=a/b;

printf("The Division is %d\n",c);

getch();

}

===================================Output=================================

Enter Two Num: 10 5

The Division is :2

Write a program to Subtraction in C

 *******Write a program to Subtraction in C *******

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();  //Previous screen clear

int a,b,c;

printf("Enter Two Num:");

scanf("%d %d",&a,&b);

c=a-b;

printf("The Sub is %d\n",c);

getch();

}

*************************************Output****************************************

Enter Two Num : 10 5

The Sub is : 5


Write a program Addition Two Number in C

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();  //Previous screen clear

int a,b,c;

printf("Enter Two Num:");

scanf("%d %d",&a,&b);

c=a+b;

printf("The Sum is %d\n",c);

getch();

}


Output:

******************************************

Enter Two Num:2   2

The Sum is 4


Data Science using Spreadsheet Software Assignment 3

Printing Workbooks select the cells you want to print and then set that area as the print area   Steps to set a print area: Select the cells...