Page

program to find sum and product of given three numbers using java script

<html>
<head><h1><center>sum and product of given three numbers</h1></center></head>
<body>
<script type="text/javascript">
a=parseInt(prompt("enter value for a"," "));
b=parseInt(prompt("enter value for b"," "));
c=parseInt(prompt("enter value for c"," "));
s=(a+b+c);
p=(a*b*c);
document.write("Sum of a,b & c"+"     =  "+s );
document.write("<br>"+"Product of a,b & c      =   "+p );
</script>
</body>
</html>

convert temperature in farenhiet to celcius using java script

<html>
<head><h1><center>convert temperature in farenhiet to celcius</h1></center></head>
<body>
<script type="text/javascript">
fr=parseFloat(prompt("enter temperature in farenhiet"," "));
c=(5*(fr-32))/9;
document.write("<br>"+"temperature in celsius is "+c);
</script>
</body>
</html>

Find the square value using java script

<html>
<head>
<script>
function square()
{
a = prompt("enter a number","");
sqr = a*a;
document.write("Squaare of number is " +sqr);
}
</script>
</head>
<body>
<button onclick="square()">Try it</button>
</body>
</html>

Find the factorial number using java script

<html>
<head>
<script>
function factorial()
{
a = prompt("enter a number","");
fact = 1;
for(i=1;i<=a;i++)
{
fact =fact*i;
}

document.write("factorial of number is " +fact);
}
</script>
</head>
<body>
<button onclick="factorial()">Try it</button>
</body>
</html>

Bubble sort in java script

<html>
<head>
<script>

document.write("Enter your list" + "<br>");
n=prompt("Enter n"," ");

a= new Array(n);
for(i=0;i<n;i++)
{
a[i]= parseInt(prompt("Enter a value"));
}

for(i=0;i<n;i++)
{
for(j=0;j<(n-i-1);j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}

document.write("Sorted List is" +"<br>");
for(i=0;i<n;i++)
{
document.write(a[i] +" ");
}
</script>
</head>

<body></body>
<html>

Find the greatest value in java script

<html>
<head>
<script>

function greatest()
{
a = prompt("enter a","");
b = prompt("enter b","");
c = prompt("enter c","");

if(a>b)
{
if(a>c)
{
document.write(a + " is greatest");
}
else
{
document.write(c + " is greatest");
}
}
else
{
if(b>c)
{
document.write(b + " is greatest");
}
else
{
document.write(c + " is greatest");
}
}
}
</script>
</head>
<body>
<button onclick="greatest()">Try it</button>
</body>
</html>

Project of Bank Management System in C language

#include<stdio.h>
#include<dos.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>
#include<process.h>

struct bank // Bank Structure
{int accno;
char name[20];
float bal;
}b;
void main()
{int ch;
clrscr();
b:printf("\n\t\t\t\t Welcome to Aarthi Banking Corporation \n\n\n\t Please select your appropriate option...");
printf("\n 1. New customer \n 2. Existing customer \n 3. Exit");
scanf("%d",&ch);
switch (ch)
{  case 1:
                     {FILE*ff;
                     ff=fopen("customer.dat","a");
                     clrscr();
                     printf("\n Welcome to Aarthi Banking Corporation (ABC.Ltd).\n It is a pleasure to have you here \n Please enter your name without spaces  :");
                     scanf("%s",&b.name);
                     clrscr();
                     printf("\n Welcome %s, please enter a suitable  account number",b.name);
                     scanf("%d",&b.accno);
                     printf("\n Please mention the initial deposit... Rs: ");
                     scanf("%f",&b.bal);
                     printf("\n Congratulations... Your account has been created.\nTo deposit please login as existing customer");
                     fwrite(&b,sizeof(b),1,ff);
                     fclose(ff);
                     getch();
                     clrscr();
                     goto b;
                     }break;

case 2:
                     { int num,count=0,n,ch,flag;
  int a,c,t;
  float amount,value,temp;
  FILE *fp;
   clrscr();
   printf("\n Welcome once again to Aarthi Banking Corporation (ABC)... ");
   printf("\n\n Please Enter your Account Number");
   scanf("%d",&num);
   fp=fopen("customer.dat","r+");
   rewind(fp);
   while(!feof(fp)&&count==0)
  {  fread(&b,sizeof(b),1,fp);
   if (b.accno==num)
   {    count=1;   }     }
   if(count==0)
   {         printf("\n Wrong account number... No such user");
   getch();
   goto b;   }
 else
    { int m;
    clrscr();
    printf("\n Welcome %s, What service would you like to avail",b.name);
    printf("\n 1. Deposit Amount ");
    printf("\n 2. Withdraw Amount ");
    printf("\n 3. View Details ");
    printf("\n 4. Foreign Exchange");
    printf("\n 5. Exit program");
    printf("\n Please Enter your choice : ");
    scanf ("%d",&m);
    switch(m)
    {case 1:
    {clrscr();
     printf("\n\n\n Dear %s, please enter the amount you wish to deposit : ",b.name);
     scanf("%f",& amount);
     b.bal=b.bal+amount;
     printf("\n Your current available bank balance is %f", b.bal);
     n=sizeof(b);
     fseek(fp,-n,SEEK_CUR);
     fwrite(&b,n,1,fp);
     fclose(fp);
     getch();
     }break;
     case 2:
    {clrscr();
     printf("\n\n\n Dear %s, please enter the amount you wish to withdraw : ",b.name);
     scanf("%f",& amount);
     if(b.bal-amount<=0)
     {printf("\n Sorry, You dont have enough money in your account");
     fclose(fp);
     getch();
     goto b;
     }
     else
     {b.bal=b.bal-amount;
     printf("\n Your current available bank balance is %f", b.bal);
     getch();
     n=sizeof(b);
     fseek(fp,-n,SEEK_CUR);
     fwrite(&b,n,1,fp);
     fclose(fp);
     goto b;
     }
     }break;
     case 3:
     { clrscr();
      printf("\n Your Account Details are as folows...");
      printf("\n\n Name : %s",b.name);
      printf("\n\n Account Number : %d ",b.accno);
      printf("\n\n Available Balance :%f ",b.bal);
      fclose(fp);
     printf("\n Press any key to continue...");
     getch();      clrscr();
     goto b;
     }break;
     case 4:
     {int x;
     float y,z;
     clrscr();
      printf("\n Welcome to the foreign exchange convertor section \n Select the currency you wish to convert.");
      printf("\n 1. US Dollar");
      printf("\n 2. Euro");
      printf("\n 3. Pound");
      scanf("%d",&x);
      switch(x)
      {
      case 1:
      {      printf("\n Please enter the amount of rupees you wish to convert");
      scanf("%f",&y);
      z=45/y;
      printf("\n The converted rate is $ %f",z);
      getch();
      goto b;
      }break;
      case 2:
      {      printf("\n Please enter the amount of rupees you wish to convert");
      scanf("%f",&y);
      z=75/y;
      printf("\n The converted rate is euro %f",z);
      getch();
      goto b;
      }break;
      case 3:
      {printf("\n Please enter the amount of rupees you wish to convert");
      scanf("%f",&y);
      z=60/y;
      printf("\n The converted rate is pound %f",z);
      getch();
      goto b;
      }break;
     default:
     exit(0);

    }    }break;}}}}}

Adding and multiply two numbers using java script

<html>
<title>script</title>
<body>
<body bgcolor="RED">
<script language="javascript">

var x=prompt("Enter the First number ");
var a=parseInt(x);
var y=prompt("Enter the Second number ");
var b=parseInt(y);
var z=prompt("Enter the choice ");
var d=parseInt(z);


if (z==1)
{
document.write("<br>The First Number is : " +x );
document.write("<br>The Second Number is : " +y );
var c=a+b;
document.write("<br>The Result Is : " +c );
}
else if(z==2)
{
document.write("<br>The First Number is : " +x );
document.write("<br>The Second Number is : " +y );
var c=a*b;
document.write("<br>The Result Is : " +c );
}
else
{
document.write("<br>wrong choice " );
}
</script>
</body>
</html>
<!-- NOTE : Choice 1 for adding and Choice 2 for multiply-->

Create a form using HTML

<html>
<head>
<title>forms</title>
</head>
<body>
<body bgcolor="GREY">
<form>
<br>FIRST NAME : <input name="text"type="text"value="your name">
<br>LAST NAME : <input name="text1"type="text"value="your name"><br><br>

<br>SEX
<br><input name="radio1"type="radio"value="m">MALE
<br><input name="radio2"type="radio"value="">FEMALE<br><br>

<br>YOUR CHOICE
<br><input name="check1"type="checkbox"value="">CAR
<br><input name="check2"type="checkbox"value="">HONDA
<br><input name="check3"type="checkbox"value="">BMW
<br><input name="check4"type="checkbox"value="">SX4<br><br>

<br><select name="items"size=0>
<option selected>HINDI
<option>ENGLISH
<option>PUNJABI
<option>URDU
</select><br><br><br>

<br><input name="submit"type="submit"value="submit">

</form>
</body>
<html>

HTML source code for implement the framing

<!-- SAVE a1.html -->

<html>
<head>
<title>ram</title
</head>
<body>
<body bgcolor="RED">
<marquee><H1>Lovely Professional University</H1></marquee>
<a href="a1.html"target="abh">click me</a> 
</body>
</html


<!--SAVE a2.html -->

<html>
<head>
<title>ram</title
</head>
<body>
<body bgcolor="BLUESKY">
<H1>RAM</H1>
<H2>ANKUR</H2>
<H3>NEERAJ</H3>
<H4>ABHINAY</H4>
</body>

</html>

<!--SAVE a3.html -->

<html>
<body>
<p>R.N.Patel</p>

<html>

<!--SAVE b.html -->

<html>
<head>
<title>ram</title
</head>
<frameset rows="25%,*">
<frame name="ram"src="a1.html">
<frameset cols="15%,25%,25%">
<frame name="ank"src="a2.html">
<frame name="abh">
<frame name="df" src="a3.html">
</frameset>
</html>

C program for finding the leap year

#include <stdio.h>
#include <conio.h>

int main()
{
  int year;

  printf("Enter a year to check if it is a leap year\n");
  scanf("%d", &year);

  if ( year%400 == 0)
    printf("%d is a leap year.\n", year);
  else if ( year%100 == 0)
    printf("%d is not a leap year.\n", year);
  else if ( year%4 == 0 )
    printf("%d is a leap year.\n", year);
  else
    printf("%d is not a leap year.\n", year);  

  return 0;
}

C program for implement the pattern mattching

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char t[50],p[50];
int n,m,s,j,i,c;
clrscr();
printf("\n Enter the main string : ");
gets(t);
n=strlen(t);
printf("\n Enter the pattern : ");
gets(p);
m=strlen(p);
for(s=0;s<=n-m;s++)
{
i=s;c=0;
for(j=0;j<=m;j++)
{
if(t[i]==p[j])
{
i++;
c=1;
}
else
{
c=0;
break;
}
}
if(c==1)
printf("\n\nString found %d",s);
}
getch();
}

C program for finding the GCD

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],c,m,n,r,i,g;
int b=100;
c=b;
clrscr();
printf("\n Enter the Number of Array : ");
scanf("%d",&m);
for(i=1;i<=m;i++)
{
printf("\n\n");
printf("\n Enter the value : ");
scanf("%d",&a[i]);
while(b!=0)
{
n=a[i]/b;
r=a[i]%b;
a[i]=n*b+r;
a[i]=b;
b=r;
}
b=c;
printf("\n\n GCD is : %d",a[i]);
}
getch();
}

C programe for implement hill cipher

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char aa[26]="abcdefghijklmnopqrstuvwxyz";
char pt[10];
int m,d,q=0,i,j,k[2][2],p[4],pp[4],t[5];
int k1[2][2],k2[2][2],det;
clrscr();
printf("enter the plaintext:" );
scanf("%s",pt);
m=strlen(pt);
printf("enter the numbers:");
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
scanf("%d",&k[i][j]);
}
}

for(i=0;i<m;i++)
{
for(j=i;j<26;j++)

{
if(pt[i]==aa[j])

{
t[q]=j%26;
++q;
}
}
}
p[0]=(k[0][0]*t[0])+(k[0][1]*t[1]);
p[1]=(k[1][0]*t[0])+(k[1][1]*t[1]);
p[2]=(k[0][0]*t[2])+(k[0][1]*t[3]);
p[3]=(k[1][0]*t[2])+(k[1][1]*t[3]);
k1[0][0]=k[1][1];
k1[0][1]=-(k[0][1]);
k1[1][0]=-(k[1][0]);
k1[1][1]=k[0][0];

det=(k1[0][0]*k1[1][1])-(k1[0][1]*k1[1][0]);
for(i=0;i<26;i++)
{
if((det*i)%26==1)
{
d=i;
}
}
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
k2[i][j]=(d*k1[i][j])%26;
}
}
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
if(k2[i][j]<0)
k2[i][j]+=26;
}
}
pp[0]=((k2[0][0]*p[0])+(k2[0][1]*p[1]))%26;
pp[1]=((k2[1][0]*p[0])+(k2[1][1]*p[1]))%26;
pp[2]=((k2[0][0]*p[2])+(k2[0][1]*p[3]))%26;
pp[3]=((k2[1][0]*p[2])+(k2[1][1]*p[3]))%26;
for(i=0;i<m;i++)
{
printf("\nThe decrypted plain text :%c",aa[pp[i]]);
}
getch();
}

HTML source code for Send email

<!DOCTYPE html>
<html>
<body>

<h3>Send e-mail to someone@example.com:</h3>

<form action="MAILTO:someone@ex.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name" value="your name"><br>
E-mail:<br>
<input type="text" name="mail" value="your email"><br>
Comment:<br>
<input type="text" name="comment" value="your comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>

</body>
</html>

HTML source code for create button

<!DOCTYPE html>
<html>
<body>

<form action="">
<input type="button" value="BUTTON">
</form>

</body>
</html>

HTML source code for create drop-down list

<!DOCTYPE html>
<html>
<body>

<form action="">
<select name="cars">
<option value="bca">bca</option>
<option value="mca">mca</option>
<option value="mba">mba</option>
<option value="bba">bba</option>
</select>
</form>

</body>
</html>

HTML source code for create radio button

<!DOCTYPE html>
<html>
<body>

<form action="">
<input type="radio" name="sex" value="male">Male<br>
<input type="radio" name="sex" value="female">Female
</form>

</body>
</html>

HTML source code for create checkboxes

<!DOCTYPE html>
<html>
<body>

<form action="">
<input type="checkbox" name="vehicle" value="mca">MCA<br>
<input type="checkbox" name="vehicle" value="mba">MBA 
</form>

</body>
</html>

HTML source code for create password field

<!DOCTYPE html>
<html>
<body>

<form action="">
Username: <input type="text" name="user"><br>
Password: <input type="password" name="password">
</form>

</body>
</html>

HTML source code for create a text field

<!DOCTYPE html>
<html>
<body>

<form action="">
First name: <input type="text" name="firstname"><br>
Middle name: <input type="text" name="middlename"><br>
Last name: <input type="text" name="lastname">
</form>

</body>
</html>

HTML source code for create a definition list

<!DOCTYPE html>
<html>
<body>

<h4>A Definition List:</h4>
<dl>
  <dt>MCA</dt>
  <dd>- Master of computer application</dd>
  <dt>BCA</dt>
  <dd>- Bachelor of computer application</dd>
</dl>

</body>
</html>

Nested list in unordered pattern

<!DOCTYPE html>
<html>
<body>

<h4>A nested List:</h4>
<ul>
  <li>MCA</li>
  <li>MBA
    <ul>
    <li>BCA</li>
    <li>BBA</li>
    </ul>
  </li>
  <li>PGDCA</li>
</ul>

</body>
</html>

HTML source code for create different types of unordered list

<!DOCTYPE html>
<html>
<body>

<h4>Circle bullets list:</h4>
<ul style="list-style-type:circle">
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ul>  

<h4>Square bullets list:</h4>
<ul style="list-style-type:square">
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ul>

<h4>Disc bullets list:</h4>
<ul style="list-style-type:disc">
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ul>  

</body>
</html>

HTML source code for create different types of ordered list

<!DOCTYPE html>
<html>
<body>

<h4>Letters list:</h4>
<ol type="A">
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ol>  

<h4>Lowercase letters list:</h4>
<ol type="a">
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ol>  

<h4>Roman numbers list:</h4>
<ol type="I">
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ol>  

<h4>Lowercase Roman numbers list:</h4>
<ol type="i">
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ol>

<h4>Numbered list:</h4>
<ol>
 <li>MCA</li>
 <li>BCA</li>
 <li>PGDCA</li>
</ol>  
  
</body>
</html>