Saturday, 30 June 2012

Simple Javascript


<html>
<head>
   <title>kamal Javascript Code</title>
</head>
<body>
<script type="text/javascript" language="JavaScript">
   document.writeln( "Hi Guys U r Using Kamal Code" );
var j = 10;
for (i=0; i<10; i++)
{
      j=j+1;
}
   document.writeln( "value of j="+j );
</script>
</body>
</html>

Friday, 29 June 2012

Css Style's


<style type="text/css">
a:link {color:#FF0000;}    /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;}   /* mouse over link */
a:active {color:#0000FF;}  /* selected link */
</style>

Sum Of Digit's In PL/SQL


set serveroutput on
declare
N number(5);
s number(5):=0;
r number(5);
d number(5);
begin
n:=&N; 
while N<>0 loop
d:=mod(N,10);
s:=s+r+d;
end loop;
dbms_output.put_line('sum of digits is-'||s);
end;
/

Find Out greatest Of Three Number's In PL/SQL

declare
a number(10);
b number(10);
c number(10);
begin
a:=&a;
b:=&b;
c:=&c;
if(a>b)and(a>c) then
dbms_output.put_line('a is greater');
elsif(b>c) then
dbms_output.put_line('b is greater');
else
dbms_output.put_line('c is greater');
end if;
end;
/

Find Out Area nd Circumference In PL/SQL

set serveroutput on
declare
rad number(5):=&r1;
ar number(5,2);
circle number(5,2);
pie constant number(5,2):=3.14;
begin
ar:=pie*rad*rad;
circle:=2*pie*rad;
dbms_output.put_line('area of circle is'|| ar);
dbms_output.put_line('circumference is'||circle);
end;
/

Insertion In Array At Different Position's Using C++


#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<dos.h>
 int a[15],i,n,item,k,j;
 void main()
 {


   void menu();
   void top(int [],int &);
   void last(int [],int &);
   void kth(int [],int &);
   void display(int [],int &);
   clrscr();
     int a[15],i,n,item;
  clrscr();
   cout<<endl<<"enter the no of elements :";
   cin>>n;
   cout<<endl<<" enter the elements : ";
     for(i=0;i<n;i++)
     {
cout<<endl<<"a["<<i<<"] = ";
cin>>a[i];
     }
     while(1)
    {
       menu();
       int o;
       cout<<endl<<endl<<"ENTER YOUR CHOICE :";
       cin>>o;
       switch(o)
       {
case 1:
top(a,n);
break;
case 2:
last(a,n);
break;
case 3:
kth(a,n);
break;
case 4:
display(a,n);
break;
case 5:
cout<<endl<<endl<<"EXITING. . . .";
delay(1000);
exit(0);
default:
cout<<endl<<endl<<"WRONG CHOICE. . .TRY AGAIN. . ";
getch();
       }
    }
 }


  void menu()
  {
    clrscr();
    cout<<endl<<endl<<"\t\t\t\t=========INSERTION IN ARRAY==========";
    cout<<endl<<"\t\t\t\t1.TOP                               ";
    cout<<endl<<"\t\t\t\t2.LAST";
    cout<<endl<<"\t\t\t\t3.KTH";
    cout<<endl<<"\t\t\t\t4.DISPLAY";
    cout<<endl<<"\t\t\t\t5.EXIT";
  }


   void top(int a[15],int &n)
   {
  n=n+1;
  cout<<endl<<"enter the item :";
  cin>>item;
     for(i=n-1;i>0;i--)
     {
a[i]=a[i-1];
     }
     a[i]=item;


   }


    void last(int a[15],int &n)
    {
  n=n+1;
  cout<<endl<<"enter the item :";
  cin>>item;
     a[n-1]=item;
    }
     void display(int a[15],int &n)
     {
      cout<<endl<<"array after insertion is :";
      for(i=0;i<n;i++)
      {
cout<<endl<<"a["<<i<<"] = "<<a[i];
      }


 getch();
     }
      void kth(int a[15],int &n)
      {
cout<<endl<<"enter the kth pos : ";
     cin>>k;
     cout<<endl<<"enter the item to be inserted at kth pos : ";
     cin>>item;
     n=n+1;
     for(int j=n-1;j>=k;j--)
     {
      a[j]=a[j-1];
     }
      a[k]=item;
      }

Linear Search Using C++


#include<iostream.h>
#include<conio.h>
  void main()
  {
   int a[15],n,i,loc,item,chk=0;
   clrscr();
    cout<<endl<<"enter the no of elements :";
    cin>>n;
     cout<<endl<<"enter the elements :";
      for(i=0;i<n;i++)
      {
cout<<endl<<"a["<<i<<"] = ";
cin>>a[i];
      }
    cout<<endl<<"enter the item to be searched :";
    cin>>item;
     for(i=0;i<n;i++)
     {
if(a[i]==item)
{
 loc=i;
 chk=1;
}
     }
      if(chk==1)
      {
       cout<<endl<<"item is present at "<<loc+1<<" loc";
      }
      else
      {
cout<<endl<<"item is not present in the list :";
      }
   getch();
  }