Page

Source Code of Analog Clock



#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<stdio.h>
#include<math.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm;
int x=320,y=240,r=200,i,h,m,s,thetamin,thetasec;
struct  time t;
char n[12][3]={"3","2","1","12","11","10","9","8","7","6","5","4"};
initgraph(&gd,&gm,"          ");
circle(x,y,210);
setcolor(4);
settextstyle(4,0,5);
for(i=0;i<12;i++)
{
if(i!=3)
outtextxy(x+(r-14)*cos(M_PI/6*i)-10,y-(r-14)*sin(M_PI/6*i)-26,n[i]);
else
outtextxy(x+(r-14)*cos(M_PI/6*i)-20,y-(r-14)*sin(M_PI/6*i)-26,n[i]);
}
gettime(&t);
printf(" THE CURRENT TIME IS : %2d:%02d:%02d.%02d",t.ti_hour, t.ti_min,t.ti_sec, t.ti_hund);
while(!kbhit())
{
setcolor(5);
setfillstyle(1,5);
circle(x,y,10);
floodfill(x,y,5);
gettime(&t);
if(t.ti_min!=m)
{
setcolor(0);
line(x,y,x+(r-60)*cos(thetamin*(M_PI/180)),y-(r-60)*sin(thetamin*(M_PI/180)));
circle(x+(r-80)*cos(thetamin*(M_PI/180)),y-(r-80)*sin(thetamin*(M_PI/180)),10);
line(x,y,x+(r-110)*cos(M_PI/6*h-((m/2)*(M_PI/180))),y-(r-110)*sin(M_PI/6*h-((m/2)*(M_PI/180))));
circle(x+(r-130)*cos(M_PI/6*h-((m/2)*(M_PI/180))),y-(r-130)*sin(M_PI/6*h-((m/2)*(M_PI/180))),10);
}
if(t.ti_hour>12)
t.ti_hour=t.ti_hour-12;
if(t.ti_hour<4)
h=abs(t.ti_hour-3);
else
h=15-t.ti_hour;
m=t.ti_min;
if(t.ti_min<=15)
thetamin=(15-t.ti_min)*6;
else
thetamin=450-t.ti_min*6;
if(t.ti_sec<=15)
thetasec=(15-t.ti_sec)*6;
else
thetasec=450-t.ti_sec*6;
setcolor(4);
line(x,y,x+(r-110)*cos(M_PI/6*h-((m/2)*(M_PI/180))),y-(r-110)*sin(M_PI/6*h-((m/2)*(M_PI/180))));
circle(x+(r-130)*cos(M_PI/6*h-((m/2)*(M_PI/180))),y-(r-130)*sin(M_PI/6*h-((m/2)*(M_PI/180))),10);
line(x,y,x+(r-60)*cos(thetamin*(M_PI/180)),y-(r-60)*sin(thetamin*(M_PI/180)));
circle(x+(r-80)*cos(thetamin*(M_PI/180)),y-(r-80)*sin(thetamin*(M_PI/180)),10);
setcolor(15);
line(x,y,x+(r-70)*cos(thetasec*(M_PI/180)),y-(r-70)*sin(thetasec*(M_PI/180)));
delay(1000);
setcolor(0);
line(x,y,x+(r-70)*cos(thetasec*(M_PI/180)),y-(r-70)*sin(thetasec*(M_PI/180)));
}
}

Mess Management System

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<process.h>
#include<iomanip.h>
#include<dos.h>
main()
 {
  clrscr();
  unsigned int sum,add,d,i,j,e,f,g,h,k,l,w,x,y,z;
  unsigned int bir=10,per=36,der=110,mur=8,par=110,cor=90,twr=1199, lur=17,tir=107,
           rer=1499;
  int qubis=1000,abis=0,qupep=1000,apep=0,quden=110,aden=0,qumun=1000,amun=0,quperk=500,aperk=0,qucoc=400,acoc=0,qutit=100,atit=0,qulux=1000,alux=0,qutid=1000,atid=0,quree=300,aree=0;
  unsigned int m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;
  char name[50],course[10],pu,c[20],a[15],b[15],ok;
  clrscr();
  main:;
  cout<<"\n\n\n\t\t\t     MESS MANAGEMENT SYSTEM";
      cout<<"\n\n\nSTUDENT INFORMATION";
      cout<<"\n\n\n\n NAME:";
      gets(name);
      cout<<"\n COURSE:";
      gets(course);
      cout<<"\n REGISTRATION ID.:";
      cin>>a;
      cout<<"\n SMART CARD NO.:";
      cin>>b;
      cout<<"\n PHONE NO.:";
      cin>>c;
      cout<<"\n ENTER BILL NO.:";
      cin>>i;
      again:;
      clrscr();
      cout<<"\n\n\n\n\1.MENU & PURCHASE";
      cout<<"\n\n\n\2.DETAILS";
      cout<<"\n\n\n\3.NEW STUDENT";
      cout<<"\n\n\n\4.QUANTITY AVAILABLE";
      cout<<"\n\n\n\5.EXIT";
      cout<<"\n\n\nENTER YOUR CHOICE:";
      cin>>d;
      clrscr();
  switch(d)
  {
     case 1:
      cout<<"\nITEMS\t\t\t\t\t\t\t      RATE(RS)";
      cout<<"\n\n\nBISCUTE\t\t\t\t\t\t\t\t10  ";
      cout<<"\n\nPEPSODENT\t\t\t\t\t\t\t36";
      cout<<"\n\nDENIM POWDER\t\t\t\t\t\t\t110   ";
      cout<<"\n\nMUNCH\t\t\t\t\t\t\t\t8  ";
      cout<<"\n\nPARK AVENUE PERFUME\t\t\t\t\t\t110   ";
      cout<<"\n\nCOCONUT HAIR OIL\t\t\t\t\t\t90  ";
      cout<<"\n\nTITAN WATCH\t\t\t\t\t\t\t1199   ";
      cout<<"\n\nLUX SOAP\t\t\t\t\t\t\t17   ";
      cout<<"\n\nTIDE\t\t\t\t\t\t\t\t107   ";
      cout<<"\n\nREEBOK SHOES\t\t\t\t\t\t\t1499   ";
      start:
      cout<<"\n\n\nDO YOU WANT TO PURCHASE(Y/N):\n";
      cin>>pu;
    if(pu=='Y'||pu=='y')
    {switch(pu)
     case 1:
      clrscr();
      cout<<"\n\n\n\t\t\t\tPURCHASE LIST";
      bis:;
      cout<<"\nBISCUTE(MAX 30): ";
      cin>>m;

      if(m>30)
      {
       cout<<"Enter Quantity Smaller than 30";
      getch();
      goto bis;
      }
      else
      abis=qubis-m;
      pep:;
      cout<<"\nPEPSODENT(MAX 2): ";
      cin>>n;
       if(n>2)
      {
       cout<<"Enter Quantity Smaller than 2";
      getch();
      goto pep;
      }
      else
      apep=qupep-n;
      den:;
      cout<<"\nDENIM POWDER(MAX 2): ";
      cin>>o;
      if(o>2)
      {
       cout<<"Enter Quantity Smaller then 2";
      getch();
      goto den;
      }
      else
      aden=quden-o;
      mun:;
      cout<<"\nMUNCH(MAX 50): ";
      cin>>p;

      if(p>50)
      {
       cout<<"Enter Quantity Smaller then 50";
      getch();
      goto mun;
      }
      else
      amun=qumun-p;
      park:;
      cout<<"\nPARK AVENUE PERFUME(MAX 2): ";
      cin>>q;

      if(q>2)
      {
       cout<<"Enter Quantity Smaller then 2";
      getch();
      goto park;
      }
      else
      aperk=quperk-q;
      coco:;
      cout<<"\nCOCONUT HAIR OIL(MAX 2): ";
      cin>>r;

      if(r>2)
      {
       cout<<"Enter Quantity Smaller then 2";
      getch();
      goto coco;
      }
      else
      acoc=qucoc-r;
      titan:;
      cout<<"\nTITAN WATCH(MAX 2): ";
      cin>>s;

      if(s>2)
      {
       cout<<"Enter Quantity Smaller then 2";
      getch();

      goto titan;
      }
      else
      atit=qutit-s;
      lux:;
      cout<<"\nLUX SOAP(MAX 10): ";
      cin>>t;

      if(t>10)
      {
       cout<<"Enter Quantity Smaller then 10";
      getch();
      goto lux;
      }
      else
      alux=qulux-t;
      tid:;
      cout<<"\nTIDE(MAX 2): ";
      cin>>u;

      if(u>2)
      {
       cout<<"Enter Quantity Smaller then 2";
      getch();
      goto tid;
      }
      else
      atid=qutid-u;
      ree:;
      cout<<"\nREEBOK SHOES(MAX 4): ";
      cin>>v;

      if(v>4)
      {
       cout<<"Enter Quantity Smaller then 4";
      getch();
      goto ree;
      }
      else
      aree=quree-v;
      cout<<"\n";
      clrscr();
      cout<<"\n\n\n\n\n\n\t\t\t\tAFFWA CANTEEN\n";
      cout<<"\n\n\t\t\t\t  CASH MEMO\n";
      cout<<"\n\nBILL NO.:"<<i;
      cout<<"\n\nNAME:";
      cout<<name;
      cout<<"\n\nCOURSE:"<<course;
      cout<<"\n\nREGISTRATION ID.:"<<a;
      cout<<"\n\nSMART CARD NO.:"<<b;
      cout<<"\n\nPHONE NO.:"<<c;
      cout<<"\n\n\n\n\n";
      cout<<"===============================================================================";
      cout<<"\nITEMS"            <<setw(40)<<"QUANTITY"<<setw(35)<<"PRICE(Rs.)";
      cout<<"===============================================================================";
      if(m>0)
        cout<<"\n\nBISCUTE"        <<setw(38)<<m<<setw(28)<<"Rs."<<m*bir;
      if(n>0)
        cout<<"\n\nPEPSODENT"        <<setw(36)<<n<<setw(28)<<"Rs."<<n*per;
      if(o>0)
        cout<<"\n\nDENIM POWDER"     <<setw(33)<<o<<setw(28)<<"Rs."<<o*der;
      if(p>0)
        cout<<"\n\nMUNCH"            <<setw(40)<<p<<setw(28)<<"Rs."<<p*mur;
      if(q>0)
        cout<<"\n\nPARK AVENUE PERFUME"<<setw(26)<<q<<setw(28)<<"Rs."<<q*par;
      if(r>0)
        cout<<"\n\nCOCONUT HAIR OIL" <<setw(29)<<r<<setw(28)<<"Rs."<<r*cor;
      if(s>0)
        cout<<"\n\nTITAN WATCH"      <<setw(34)<<s<<setw(28)<<"Rs."<<s*twr;
      if(t>0)
        cout<<"\n\nLUX SOAP"         <<setw(37)<<t<<setw(28)<<"Rs."<<t*lur;
      if(u>0)
        cout<<"\n\nTIDE"             <<setw(41)<<u<<setw(28)<<"Rs."<<u*tir;
      if(v>0)
        cout<<"\n\nREEBOK SHOES"     <<setw(33)<<v<<setw(28)<<"Rs."<<v*rer;
        e=m*bir;
        f=n*per;
        g=o*der;
        h=p*mur;
        k=q*par;
        l=r*cor;
        w=s*twr;
        x=t*lur;
        y=u*tir;
        z=v*rer;
        sum=e+f+g+h+k+l+w+x+y+z;
        add=m+n+o+p+q+r+s+t+u+v;
        cout<<"\n===============================================================================";
        cout<<"\nTOTAL:"<<setw(40)<<add<<setw(27)<<"Rs."<<sum;
        cout<<"\n\nTHANK YOU .\t\t\t     VISIT US AGAIN\n";
    getch();
    clrscr();
    goto again;
    }
    else
    {goto again;

    }


    case 2:
    cout<<"\n\n\n\n\n\t\t\t\tCANTEEN DETAILS";
    cout<<"\n\n#TIMING:\n\n 11 AM TO 02 PM \n 03 PM TO 05 PM";
    cout<<"\n\n#CANTEEN WILL CLOSED ON TUESDAY";
    cout<<"\n\n#GOODS ONCE SOLD WILL NOT BE EXCHANGED/REPLACED";
    cout<<"\n\n#TAKE YOUR SMART CARD WITH YOU";
    cout<<"\n\n#COLLECT YOUR SMART CARD & BILL AFTER PAYMENT";
    cout<<"\n\n#DO NOT BREAK ANY CANTEEN ITEMS";
    getch();
    clrscr();
    goto again;
    case 3:
    goto main;
    case 4:
       if(m>0||n>0||o>0||p>0||q>0||r>0||s>0||t>0||u>0||v>0)
      {cout<<"\n\t\t\tItems Avaliable in Canteen.\n\n\n";
      cout<<"===============================================================================";
      cout<<"\nITEMS"            <<setw(40)<<"QUANTITY";
      cout<<"\n===============================================================================";
      cout<<"\n\n\nBISCUTE"        <<setw(38)<<abis;
      cout<<"\n\n\nPEPSODENT"        <<setw(36)<<apep;
      cout<<"\n\n\nDENIM POWDER"     <<setw(33)<<aden;
      cout<<"\n\n\nMUNCH"            <<setw(40)<<amun;
      cout<<"\n\n\nPARK AVENUE PERFUME"<<setw(26)<<aperk;
      cout<<"\n\n\nCOCONUT HAIR OIL" <<setw(29)<<acoc;
      cout<<"\n\n\nTITAN WATCH"      <<setw(34)<<atit;
      cout<<"\n\n\nLUX SOAP"         <<setw(37)<<alux;
      cout<<"\n\n\nTIDE"             <<setw(41)<<atid;
      cout<<"\n\n\nREEBOK SHOES"     <<setw(33)<<aree;
      cout<<"\n*******************************************************************************";
      getch();
      goto again;
      }
      else
      {{cout<<"\n\t\t\tItems Avaliable in Canteen.\n\n\n";
      cout<<"===============================================================================";
      cout<<"\nITEMS"            <<setw(40)<<"QUANTITY";
      cout<<"\n===============================================================================";
      cout<<"\n\n\nBISCUTE"        <<setw(38)<<qubis;
      cout<<"\n\n\nPEPSODENT"        <<setw(36)<<qupep;
      cout<<"\n\n\nDENIM POWDER"     <<setw(33)<<quden;
      cout<<"\n\n\nMUNCH"            <<setw(40)<<qumun;
      cout<<"\n\n\nPARK AVENUE PERFUME"<<setw(26)<<quperk;
      cout<<"\n\n\nCOCONUT HAIR OIL" <<setw(29)<<qucoc;
      cout<<"\n\n\nTITAN WATCH"      <<setw(34)<<qutit;
      cout<<"\n\n\nLUX SOAP"         <<setw(37)<<qulux;
      cout<<"\n\n\nTIDE"             <<setw(41)<<qutid;
      cout<<"\n\n\nREEBOK SHOES"     <<setw(33)<<quree;
      cout<<"\n\n*******************************************************************************";
      getch();
      goto again;

      }
    case 5:
    cout<<"\n\n\n\n\n\n\n\n\n\t\t\t\t   THANKS";
    sleep(1);
    clrscr();
    cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t   THANKS\n\n\n\t\t\t\tPress any key to Exit.......";
    getch();
    exit(0);
    default:
        cout<<"Your choice is wrong";
    getch();
    goto again;
     }
 }

}

Program to reverse array in java script

<html>
<head><center><h1>to reverse array</h1></center>
<title>date function</title>
<script type="text/javascript">
a=new Array(4);
alert("enter the elements of array");
for(i=0;i<a.length;i++)
{
a[i]=parseInt(prompt("enter value"," "));
}
alert("the array is");
for(i=0;i<a.length;i++)
{
document.write("<br>"+"a["+i+"] ="+a[i]);
}
b=new Array(4);
b=a.reverse();
document.write("the reversed array is ");
for(i=0;i<b.length;i++)
{
document.write("<br>"+"b["+i+"] ="+b[i]+"<br>");
}
</script>
</head>
</html>

Program to watch time at title bar in java script

<html>
<head><center><h1>watch time at title bar</h1></center>
<title>date function</title>
<script type="text/javascript">
function disp_time()
{
d=new Date();
hr=d.getHours();
mn=d.getMinutes();
sc=d.getSeconds();
document.write("date :"+d.getDate()+"<br>");
document.write("time :"+hr+":"+mn+":"+sc);
}
</script>
</head>
<body onclick="disp_time()">
</html>

Program for multiplication of two matrices in java script

<html>
<head><h2><center>program for multiplication of two matrices"</h2></center></head>
<body>
<script type="text/javascript">
function mul()
{
m=parseInt(prompt("enter the number of rows for ist matrix"," "))
n=parseInt(prompt("enter the number of columns for ist matrix"," "));
p=parseInt(prompt("enter the number of rows for 2nd matrix"," "));
q=parseInt(prompt("enter the number of columns for 2nd matrix"," "));

if(n==p)
{
alert("enter elements for first matrix");
a = new Array(m);
for(i=0;i<m;i++)
{
a[i]=new Array(n);
}
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
a[i][j]=parseInt(prompt("enter value"," "));
}}
b=new Array(p);
for(i=0;i<p;i++)
{
b[i]= new Array(q);
}
alert("enter elements for second matrix");
for(s=0;s<p;s++)
{
for(t=0;t<q;t++)
{
b[s][t]=parseInt(prompt("enter value"," "));
}}

c=new Array(m);
for(i=0;i<m;i++)
{
c[i]=new Array(q);
}


for(i=0;i<m;i++)
{
for(j=0;j<q;j++)
{
c[i][j]=0;
for(k=0;k<p;k++)
{
c[i][j]=parseInt(c[i][j]+parseInt((a[i][k]*b[k][j])));
}}}
document.write("the multiplication  of  two matrices is =>"+"<br>");
for(i=0;i<m;i++)
{
document.write("<br>");
for(j=0;j<q;j++)
{
document.write(c[i][j]+"&nbsp&nbsp");
}}}
else
document.write("multiplication not possible");
}
</script>
<button onclick="mul()">multiply</button>
</body>
</html>

Program to add two matrices of order m x n in java script

<html>
<head><h2><center>program to add two matrices of order m x n</h2></center></head>
<body>
<script type="text/javascript">
function add()
{
m=parseInt(prompt("enter the number of rows"," "));
n=parseInt(prompt("enter the number of columns"," "));
alert("enter elements for first matrix");
a = new Array(m);
for(i=0;i<m;i++)
{
a[i]=new Array(n);
}
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
a[i][j]=parseInt(prompt("enter value"," "));
}}
b=new Array(m);
for(i=0;i<m;i++)
{
b[i]=new Array(n);
}
alert("enter elements for second matrix");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
b[i][j]=parseInt(prompt("enter value"," "));
}}

c=new Array(m);
for(i=0;i<m;i++)
{
c[i]=new Array(n);
}
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
c[i][j]=parseInt(a[i][j]+b[i][j]);
}}
document.write("the addition of  two matrices is =>"+"<br>");
for(i=0;i<m;i++)
{
document.write("<br>");
for(j=0;j<n;j++)
{
document.write(c[i][j]+"&nbsp&nbsp");
}}
}
</script>
<button onclick="add()">sum</button>
</body>
</html>

Program to table of any number in java script

<html>
<head><h2><center>program to table of any number</h2></center></head>
<body>
<script type="text/javascript">
n=parseInt(prompt("enter the number of which we have to print the table"," "));
document.write("table of "+n+"  is  =>"+"<br>");
for(i=1;i<=10;i++)
{
m=n*i;
document.write(n+"*"+i+" =   "+m+"<br>");
}
</script>
</body>
</html>

Program to print the series in java script

<html>
<head><h2><center>program to print the series</h2></center></head>
<body>
<script type="text/javascript">
n=parseInt(prompt("enter the number of rows"," "));
for(i=1;i<=n;i++)
{
document.write("<br>");
for(j=1;j<=n-i;j++)
document.write("&nbsp&nbsp");
for(k=1;k<=i;k++)
document.write(k);
for(l=i-1;l>0;l--)
document.write(l);
}
</script>
</body>
</html>

Program to evaluate series 1+1/2+1/3+1/4+-------+1/N in java script

<html>
<head><h2><center>program to evaluate series 1+1/2+1/3+1/4+-------+1/N</h2></center></head>
<body>
<script type="text/javascript">
n=parseInt(prompt("enter the value for n"," "));
s=0.0;
for(i=1;i<=n;i++)
{
s=s+(1/i);
}
document.write("the sum of series is "+s);
</script>
</body>
</html>

Program to find the reverse of a number in java script

<html>
<head><h2><center>program to find the reverse of a number</h2></center></head>
<body>
<script type="text/javascript">
n=parseInt(prompt("enter the number"," "));
rev=0;
x=n;
while(n>0)
{
m=n%10;
rev=parseInt(rev*10+m);
n=parseInt(n/10);
}
document.write("reverse of a given number "+x+"  is "+rev);
</script>
</body>
</html>

Program to check wheather the given number is armstrong or not in java script

<html>
<head><h2><center>program to check wheather the given number is armstrong or not</h2></center></head>
<body>
<script type="text/javascript">
n=parseInt(prompt("enter the number"," "));
sum=0;
x=n;
while(n>0)
{
m=n%10;
l=m*m*m;
sum=parseInt(sum +l);
n=parseInt(n/10);
}
document.write(sum);
if(sum==x)
document.write("number "+x+"  is armstrong number");
else
document.write("number "+x+"is not an armstrong number");
</script>
</body>
</html>

Program to print the sum of digits of given number in java script

<html>
<head><h2><center>program to print the sum of digits of given number</h2></center></head>
<body>
<script type="text/javascript">
n=parseInt(prompt("enter the number"," "));
sum=0;
x=n;
while(n>0)
{
m=n%10;
n=n/10;
sum=parseInt(sum+m);
}

document.write("the sum of digits of "+"     "+x+"   "+"is   "+"     "+sum);
</script>
</body>
</html>

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;}}}}}