Friday, March 30, 2018

What Is Index In SQL Server.

This Is A ppt About What is Index All the description about index are given into the ppt.

In this ppt there are introduction to index,types of index, how to create index all are given in brief.

Download INDEX PPT Here 

How To Print Fibonacci Series In C++

This is a example of how to print Fibonacci series in c++.


#include<stdio.h>
#include<conio.h>
#include<iostream.h>
class fibbonacci
{
int a,b,s;
public :
fibbonacci() //constructor
{
a=0;b=1;
}
void nextstep()
{
s=a+b;
b=a;
a=s;
}
void display()
{
cout<<"\t"<<s;
}
};
void main()
{
fibbonacci f1;
int n,i;
clrscr();
cout<<"\n\nEnter NO :";
cin>>n;
for(i=0;i<n;i++)
{
f1.nextstep();
f1.display();
}
getch();
}  

How To Find Area Of Circle In C++

This program is about how to find area of circle in c++.

#include<conio.h>
#include<iostream.h>
class  circle
{
float redius;
public :
void input()
{
cout<<"\nRedius : "; cin>>redius;
}
float area()
{
return 3.14*redius*redius;
}
};
class cylinder : public circle
{
float height;
public :
void input()
{
circle::input();
cout<<"\nHeight  : ";
cin>>height;
}
float volume()
{
return area()*height;
}
};
void main()
{
cylinder c;
clrscr();
c.input();
cout<<"\n\n\t Area of Circle ..." << c.area();
cout<<"\n\n\t Volume of Cylinder... " <<c.volume();
getch();
}

How To find ASCII Value Of Character In C++.

This program is about how to find ascii value of character in c++.


#include<conio.h>
#include<stdio.h>
#include<iostream.h>
int main()
{
char ascii;
clrscr();
cout<<"enter your character:";
cin>>ascii;
cout<<"ascii valu is:"<<(int)ascii<<endl;
getch();
return 0;
}

How To Find Simple Intrest In C++.

This Program is about how to find simple interest of given value in input in c++.


#include<conio.h>
#include<stdio.h>
#include<iostream.h>
int main()
{
long p;
int n;
float si,r;
clrscr();
cout<<"\n enter a value for principal:";
cin>>p;
cout<<"\n enter a value for a year:";
cin>>n;
cout<<" \n enter a value for a rate:";
cin>>r;
si=p*n*r/100;
cout<<"\n simple intrest is:"<<si;
getch();
return 0;

How To Implement Forms-Based Authentication in ASP.NET

This Is A Simple Example Of How To Create Form Authentication In Asp.net.
x




1.Default.aspx.cs file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public bool check()
    {
        SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\Bhavesh\Documents\Visual Studio 2010\WebSites\authentication\App_Data\Database.mdf';Integrated Security=True;User Instance=True");
        string select = "select * from login where username=@username and password=@password";
        con.Open();
        SqlCommand cmd = new SqlCommand(select, con);
       
        cmd.Parameters.Add("@username", TextBox1.Text);
        cmd.Parameters.Add("@password", TextBox2.Text);
        Object obj = cmd.ExecuteScalar();
        con.Close();
        if (obj != null)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (check())
        {

            Response.Write("<script>alert('you are authorize user')</script>");
        }
        else
        {
            Response.Write("hello");
        }
    }
}

2 Default.aspx File


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    username:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
    password:<asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox><br />
    <asp:Button ID="Button1" runat="server" Text="Login" onclick="Button1_Click"></asp:Button>
    </div>
    </form>
</body>
</html>


3 Web.config File

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
<appSettings/>
<connectionStrings>
<add name="constring" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Users\Bhavesh\Documents\Visual Studio 2010\WebSites\authentication\App_Data\Database.mdf';Integrated Security=True;User Instance=True"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms name="login" loginUrl="Default.aspx" timeout="30">
</forms>
</authentication>
</system.web>
</configuration>

How To Print Mark OF Subject In C++.

#include<conio.h>
#include<stdio.h>
#include<iostream.h>
int main()
{
clrscr();
cout<<" mark of mathematics is :90\n";
cout<<" mark of computer is:77\n";
cout<<" mark of chemistry is :60\n";
getch();
return 0;
}

How To Count Sum Of Two Number IN C++.

#include<conio.h>
#include<stdio.h>
#include<iostream.h>
int main()
{
int a,b,c;
cout<<"\n enter your no1:";
cin>>a;
cout<<"\n enter your no2:";
cin>>b;
c=a+b;
cout<<" sum is:"<<c<<endl;
getch();
return 0;

}

How To Create Login Form In PHP

This Example Is About How To Create Login Form In PHP With The Use Of Html And Java script.



How-To-Create-Login-Form-In-Php



<?php

if(isset($_POST['submit']))
{
require 'include/config.php';
$username=$_POST['username'];
$pass=$_POST['password'];
$select=mysqli_query($con,'select *from admin_login where username="'.$username.'" and password="'.$pass.'"');
if(mysqli_num_rows($select)==1)
{
$_SESSION['username']=$username;
header('Location: home.php');
}
else
{
?>
    <script>
        alert('username or password are invalid');
    </script>

    <?php
}

}

?>

        <!DOCTYPE html>
        <html>

        <head>
            <meta charset="utf-8">

            <link rel="shortcut icon" href="assets/images/favicon_1.ico">

            <title>Patanjali Admin Dashboard </title>

            <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
            <link href="assets/css/core.css" rel="stylesheet" type="text/css" />
            <link href="assets/css/components.css" rel="stylesheet" type="text/css" />
            <link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
            <link href="assets/css/pages.css" rel="stylesheet" type="text/css" />
            <link href="assets/css/responsive.css" rel="stylesheet" type="text/css" />

            <script src="assets/js/modernizr.min.js"></script>

        </head>

        <body>

            <div class="account-pages"></div>
            <div class="clearfix"></div>
            <div class="wrapper-page">
                <div class=" card-box">
                    <div class="panel-heading">
                        <h3 class="text-center"> Sign In to <strong class="text-custom">Patanjali Admin</strong> </h3>
                    </div>

                    <div class="panel-body">
                        <form class="form-horizontal m-t-20" method="post">

                            <div class="form-group ">
                                <div class="col-xs-12">
                                    <input class="form-control" type="text" name="username" required placeholder="Username">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-xs-12">
                                    <input class="form-control" type="password" name="password" pattern="(.){5,15}" required placeholder="Password">
                                </div>
                            </div>

                            <div class="form-group text-center m-t-40">
                                <div class="col-xs-12">
                                    <button class="btn btn-pink btn-block text-uppercase waves-effect waves-light" type="submit" name="submit">Log In</button>
                                </div>
                            </div>

                    </div>

                </div>

                <script>
                    var resizefunc = [];
                </script>

                <!-- jQuery  -->
                <script src="assets/js/jquery.min.js"></script>
                <script src="assets/js/bootstrap.min.js"></script>
                <script src="assets/js/detect.js"></script>
                <script src="assets/js/fastclick.js"></script>
                <script src="assets/js/jquery.slimscroll.js"></script>
                <script src="assets/js/jquery.blockUI.js"></script>
                <script src="assets/js/waves.js"></script>
                <script src="assets/js/wow.min.js"></script>
                <script src="assets/js/jquery.nicescroll.js"></script>
                <script src="assets/js/jquery.scrollTo.min.js"></script>

                <script src="assets/js/jquery.core.js"></script>
                <script src="assets/js/jquery.app.js"></script>

        </body>

        </html>

How To Create Registration Form IN PHP

How To Create Registration Form IN PHP


How To Create Login Form IN PHP




This is a example of hoe to create login form in php using html and java script.





<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <table width="100%" border="0" align="center">
        <tr>
            <td><img src="nirav_logo.jpg"></td>
        </tr>
        <tr>
            <td>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td id="rc3"></td>
                        <td id="links-bg">
                            <table border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="toplinks"><a href="home.php">HOME</a></td>
                                    <td class="sap"></td>
                                    <td class="toplinks"><a href="login.php">LOGIN</a></td>
                                    <td class="sap"></td>
                                    <td class="toplinks"><a href="registration.php">REGISTRATION</a></td>
                                    <td class="sap"></td>
                                    <td class="toplinks"><a href="contact.php">CONTACT US</a></td>
                                    <td class="sap"></td>
                                    <!-- <td class="toplinks"><a href="jr_regfrm.php">EMPLOYER REGSTRATION</a></td>
<td class="sap"></td>
            <td class="toplinks"><a href="contactus.php">CONTACT US</a></td>
      </tr> -->
                            </table>
                        </td>
                        <td id="rc4"></td>
                        </tr>
                </table>
            </td>
            </tr>
            <tr>
                <td style="background-color:#ffffff;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                                <table width="919" border="0" align="center" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td valign="top">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td width="919" valign="top">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr> </tr>
                                                <tr>
                                                    <td valign="top">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td class="main-head">Welcome To AddressBook</td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top"></td>
                                                </tr>
                                                <tr>
                                                    <td valign="top">
                                                        <pre>
<center>
<center><foNT color="#00FF00" size="+4" face="monotype corsiva">REGISTRATION FORM</font></center>
<form name="form1" action="" method="post">
<table>
<tr>
<td>username</td>
<td> <input type="text" name="text1"></td>
</tr>
<tr>
<td>password</td>
<td> <input type="password" name="text2"></td>
</tr>

<tr>
<td>firstname</td>
<td> <input type="text" name="text3"></td>
</tr>
<tr>
<td>lastname</td>
<td> <input type="text" name="text4"></td>
</tr>

<tr>
<td>date of birth</td>
<td> <input type="text" name="text5"></td>
</tr>
<tr>
<td>email address</td>
<td> <input type="text" name="text6"></td>
</tr>

<tr>
<td>mobile no</td>
<td> <input type="text" name="text7"></td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="submit1" value="submit"></center></td>
</tr>
<tr>
<td>
<?php
if(isset($_POST["submit1"]))
{

if( $_POST["text2"]=="" || $_POST["text6"]=="" || $_POST["text7"]=="")
{
echo "<font color=red>";echo "Please enter value in textbox"; echo "</font>";
return;
}
               if(!preg_match("/^[0-9]{10}$/", $_POST["text7"]))
    {
echo "<center>"; echo "<font color=blue>"; echo "<b>"; echo "please enter 10 digit mobile number"; echo "<b>"; echo "</font>"; echo "</center>";
    return;
}

else if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is', $_POST["text6"]))
{
echo "<center>"; echo "<font color=blue>"; echo "<b>"; echo "please enter valid email adddress"; echo "<b>"; echo "</font>"; echo "</center>";
    return;
}

if(!preg_match("/^[0-9]{6}$/", $_POST["text2"]))
    {
echo "<center>"; echo "<font color=blue>"; echo "<b>"; echo "please enter 8 digit password"; echo "<b>"; echo "</font>"; echo "</center>";
    return;
}

$con = mysql_connect("localhost","root","");

mysql_select_db("addressbook", $con);

$sql="INSERT INTO registration
VALUES('','$_POST[text1]','$_POST[text2]','$_POST[text3]','$_POST[text4]','$_POST[text5]','$_POST[text6]','$_POST[text7]')";

mysql_query($sql,$con);

echo "1 record added";

mysql_close($con);

}

?>

</td>
</tr>
</table>
</form>

</center>

</pre>

                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="main-head"></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table border="0" align="center" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td id="rc1"></td>
                                        <td id="bottom">
                                            <table border="0" align="center" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td class="bottomlinks"><a href="home.php">HOME</a></td>
                                                    <td class="sap2">|</td>
                                                    <td class="bottomlinks"><a href="aboutus.php">ABOUT US</a></td>
                                                    <td class="sap2">|</td>
                                                    <td class="bottomlinks"><a href="contactus.php">CONTACT US</a></td>

                                                </tr>
                                            </table>
                                        </td>
                                        <td id="rc2"></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td height="28" align="center">CREATED BY BHAVESH METHANIYA</td>
                        </tr>
                    </table>
                </td>
            </tr>
    </table>
</body>

</html>

Wednesday, March 28, 2018

How To Find Maximum Number Using JavaScript.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
var a=10;
var b=40;
var c=50;
if(a>b)
{
  document.write("max is a="+a);
}
else if(b>c)
{
  document.write("max is b="+b);
}
else if(c>a)
{
  document.write("max is c="+c);
}
</script>
</head>
<body>

</body>
</html>

How To Find Minimum No In JavaScript.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
function valid()
{
   var i=parseInt(document.niks.txta.value);
   var j=parseInt(document.niks.txtb.value);
    if (i>j)
  {
           alert("min is="+j);
}
else
  {
      alert("min is="+i);
    }
}

</script>
</head>

<body>
<form name="niks">
enter value of a=<input type="text" name="txta" /></br>
enter value of b=<input type="text" name="txtb" /></br>
<input type="button" value="submit" name="btnsub"  onclick="valid();"/>
</form>

</body>
</html>

Monday, March 26, 2018

How To Sort String Program In Java

this program is about how to sort string in java.


import java.util.Scanner;
public class sortstring
{

public static void main(String[] args)
{
int i,j;
String temp;
String str[]=new String[5];
Scanner sc=new Scanner(System.in);
System.out.println("enter string up to 5:");
for(i=0;i<5;i++)
{
str[i]=sc.nextLine();
}
for(i=0;i<5;i++)
{
for(j=1;j<5;j++)
{
if(str[j-1].compareTo(str[j])>0)
{
temp=str[j-1];
str[j-1]=str[j];
str[j]=temp;

}
}
}
System.out.println("Sorted string is below:\n");
for(i=0;i<5;i++)
{
System.out.println(str[i]);
}

}

}

How To Get Current Date And Time In Java Program

This Program is About how to display current time and date as output.


package ass7;
import java.util.*;
import java.util.Date;
public class datetime
{

public static void main(String[] args)
{
Date date=new Date();
System.out.println(""+date);
Calendar cal= Calendar.getInstance();
int monthday=cal.get(Calendar.DAY_OF_MONTH);
System.out.println("Day of month is:"+monthday);


}

}

How To Draw All shapes in java Program

This Program Is How To Draw Different Shapes In Java


package a;
import java.*;
import java.applet.*;
import java.awt.*;
import java.awt.color.*;
/*
 * <applet code="allshape.class" width=100 height=100>
 * </applet>
 * */
public class allshape extends Applet implements Runnable
{

String msg="moving Banner";
char cha;
boolean stopFlag=true;
Thread t=null;
public void start()
{
t=new Thread(this);
stopFlag=false;
t.start();
}
public void run()
{
for(;;)
{
try
{
repaint();
Thread.sleep(250);
cha=msg.charAt(3);
msg=msg.substring(1,msg.length());
}
catch(InterruptedException e)
{

}
}
}
public void stop()
{
stopFlag=true;
t=null;
}
public void paint(Graphics g)
{
g.drawLine(5, 100, 300, 100);
g.drawLine(5, 200, 300, 200);
g.drawLine(100, 5, 100, 300);
g.drawLine(200, 5, 200, 300);
g.drawOval(25, 30, 50, 50);
g.drawRect(125, 40, 60, 50);
g.setColor(Color.red);
g.fillRoundRect(210, 25, 80, 50, 25, 25);
g.fillOval(5, 125, 75, 40);
g.setColor(Color.black);
g.drawLine(200, 200, 100, 100);
g.drawArc(225, 125, 100, 100, 50, 150);

g.setColor(Color.red);
g.drawLine(15, 300, 75, 300);
g.drawLine(15, 300, 35, 250);
g.drawLine(35, 250, 75, 300);
g.setColor(Color.black);
g.drawString("vvp", 125, 250);
g.drawString(msg, 225, 250);


}
}

What Is Network Level Security And Antivirus In SQL Server 2012 PPT

This is PPT About network level security and antivirus in sql server 2012

Download Here

What Is DBCC Commands In Sql Server

DBCC Commands :-

                         DBCC stands for database console commands. We use these commands to check consistency of the database 

Following Are The List Of DBCC Commands:-


DBCC CHECKALLOC   - Check consistency of disk allocation.
DBCC CHECKCATALOG - Check catalog consistency
DBCC CHECKCONSTRAINTS - Check integrity of table constraints.
DBCC CHECKDB    - Check allocation, and integrity of all objects.
DBCC CHECKFILEGROUP - Check all tables and indexed views in a filegroup.
DBCC CHECKIDENT - Check identity value for a table.
DBCC CHECKTABLE - Check integrity of a table or indexed view.
DBCC CLEANTABLE - Reclaim space from dropped variable-length columns.
DBCC dllname    - Unload a DLL from memory.
DBCC DROPCLEANBUFFERS - Remove all clean buffers from the buffer pool.
DBCC FREE... CACHE  - Remove items from cache.
DBCC HELP        - Help for DBCC commands.
DBCC INPUTBUFFER - Display last statement sent from a client to a database instance.
DBCC OPENTRAN    - Display information about recent transactions.
DBCC OUTPUTBUFFER - Display last statement sent from a client to a database instance.
DBCC PROCCACHE   - Display information about the procedure cache
DBCC SHOW_STATISTICS - Display the current distribution statistics
DBCC SHRINKDATABASE - Shrink the size of the database data and log files.
DBCC SHRINKFILE  - Shrink or empty a database data or log file.
DBCC SQLPERF     - Display transaction-log space statistics. Reset wait and latch statistics.
DBCC TRACE...    - Enable or Disable trace flags
DBCC UPDATEUSAGE - Report and correct page and row count inaccuracies in catalog views
DBCC USEROPTIONS - Return the SET options currently active
 DBCC MEMORYSTATUS - Displays how the SQL Server buffer cache is divided up, including buffer activity.
DBCC CACHESTATS - Displays information about the objects currently in the buffer cache.
DBCC CACHESTATS - Displays information about the objects currently in the buffer cache.



How To Print Odd Numbers In JavaScript Using For Loop

This Program Is About How To Print Odd Numbers In JavaScript Using For Loop


<html>

<head>
<title>

How To Print Odd Numbers In JavaScript Using For Loop

</title>
</head>
<body>
<script language="javascript">
var n,i;
n=prompt("Enter A Number",0)
for(i=1;i<=n;i++)
{
if(i%2!=0)
{
document.write("<br>"+i);
}
}
</script>

</body>
</html>

Sunday, March 25, 2018

How To Find Area Of A Circle, Triangle And Simple Interest Using JavaScript

This Program Is About How To Find Area Of A Circle, Triangle And Simple Interest Using JavaScript



<html>
<head>
<title></title>
</html>
<body>

<script language="javascript">
var ch;
document.write("1 for area of circle<br>")
document.write("2 for area of triangle<br>")
document.write("3 for area of simple interest<br>")
ch=prompt("Enter choice:",0)
ch=eval(ch)
switch(ch)
{
case 1: r=prompt("Enter radious:",0)
aoc=3.14*(r*r);
document.write("area of circle:"+aoc);
break;
case 2: l=prompt("Enter l:",0)
b=prompt("Enter b:",0)
aot=(l*b)/2;
document.write("area of triangle:"+aot);
break;
case 3: p=prompt("Enter p:",0)
r=prompt("Enter r:",0)
n=prompt("Enter n11:20 AM 7/20/2009:",0)
si=(p*r*n)/100;
document.write("interest is:"+si);
break;
default:
document.write("invalid input:");
}


</script>

</body>
</thml>

How To Print Even Numbers In JavaScript Using For Loop.

How To Print Even Numbers In JavaScript Using For Loop



<html>
<head>

<title>How To Print Even Numbers In JavaScript Using For Loop</title>
</head>
<body>

<script language="javascript">
var n,i;
n=prompt("Enter limit",0)
for(i=1;i<=n;i++)
{
if(i%2==0)
{
document.write("<br>"+i);
}
}
</script>

</body>
</html>

Sum Of N Number In JavaScript.

This Program Is How To Count Sum Of N Number In JavaScript.


<html>

<head>

<title>Sum Of N Number In JavaScript.</title>
</head>
<body>

<script language="javascript">
var n,i,sum=0;
n=prompt("Enter n number limit",0)
for(i=1;i<=n;i++)
{
sum=sum+i;
}
document.write("sum upto given no is:"+sum);
</script>

</body>
</html>

Program In JavaScript To Find Factorial Of A Number Using Prompt Box.

This Program In JavaScript To Find Factorial Of A Number Using Prompt Box.



<html>
<head>

<title>Program In JavaScript To Find Factorial Of A Number Using Prompt Box.</title>
</head>

<body>

<script language="javascript">
var n,i,fact=1;
n=prompt("Enter number",0)
for(i=n;i>=1;i--)
{
fact=fact*i;
}
document.write("factorial is:"+fact);
</script>

</body>
</html>

Fibonacci Series Program In HTML.

This Program Is About How To Create Fibonacci Series In HTML.



<html>

<head>
<title></title>
</head>
<body>
<script language="javascript">

var no1=0,no2=1,sum;
n=prompt("Enter limit",0)
document.write(" "+no1)
document.write(" "+no2)
for(i=1;i<=n;i++)
{
sum=no1+no2;
no1=no2;
no2=sum;
document.write(" "+sum)
}

</script>

</body>
</html>

Armstrong Program In HTML.

This Program Is About How To Check Number Is Armstrong Or Not In HTML.



<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<script language="javascript">
var no;
var temp;
var sum=0;
var original;
no=parseInt(prompt("enter number:"));
original=no;
while(no>0)
{
temp=no%10;
sum+=(temp*temp*temp);
no=parseInt(no/10);
}
if(sum==original)
{
document.write("This is an Armstrong No=",original);
}
else
{
document.write("This is Not an Armstrong No=",original);
}
</script>

</body>
</html>

Saturday, March 24, 2018

ABCD Pyramid Program In PHP

This Program Is About How To Create Pyramid Of ABC In PHP. 



<?php
echo"<br>";

$i;
$j;
for($i=65;$i<=69;$i++)
{
for($j=65;$j<=$i;$j++)
{
echo chr($j);
}
echo"<br>";
}
?>

Number Pyramid Program In PHP

This Program Is About How To Create Pyramid Of Number In PHP.


1 next program


<?php
$i;
$j;
for($i=1;$i<=5;$i++)
{
for($j=$i;$j>=1;$j--)
{
echo"$j   ";
}
echo"<br>";
}
?>

2 next program



<?php
echo"<br>";

$i;
$j;
for($i=1;$i<=5;$i++)
{
for($j=1;$j<=$i;$j++)
{
echo"$j";
}
echo"<br>";
}
?>



3 next program


<?php

echo"<br>";
$i;
$j;
for($i=1;$i<=5;$i++)
{
for($j=$i;$j>=1;$j--)
{
echo"$i";
}
echo"<br>";
}
?>

Find The Cube Of A Number In PHP

This Program Is About How To Find Cube Of Given Number In PHP.


PHP CODE FILE


<?php

echo"<h2> 2 cube of no <h2>";
function cube($a)

{
$cube=$a*$a*$a;
return $cube;
}
$x=5;
$ans=cube($x);
echo"cube is:".$ans;


?>

Find The Square Root Of A Number In PHP

This Program Is About How To Find Square Root Of Given Number In PHP.


PHP CODE FILE


<?php
function sqr($a)

{
$sqr=$a*$a;
return $sqr;
}
$x=5;
$ans=sqr($x);
echo"<h1>1 squre root <h1>";
echo"squre is:".$ans;

?>

Palindrome Program In PHP Using While Loop

This Program Is About How To Given Number Is Palindrome Or Not In Php


PHP FILE CODE

<?php
$n=1234;
$R=0;
$d=$a;
while($d!=0)
{
$R=$R*10;
$R=$R+($n%10);
$n=(int)($n/10);
}
if($R==$d)
{
echo "Number is Palindrome";
}
else
{
echo "Number is Not Palindrome";
}
?>

Odd And Even Number Program In PHP


This Program Is About How To Find Odd And Even Number In Php Using Given Number Into The Html Text Box.


PHP FILE CODE


<?php
$n=$_POST['n'];


    if(isset($_POST['submit']))
{
for($i=0;$i<=$n;$i++)
{

if($i%2==0)
     {
$s+=$i;
echo $s;
}
else
{
$o+=$i;
echo $o;

}
}
}
else
{
}
?>

HTML FILE CODE


<html>
    <head>
<title>odd even number</title>
</head>
<body>
<form method="post">
range start 0;
<input  type="text" name="n">
<input  type="submit" name="submit" value="submit">
</form>

<input type="text" value="<?php echo $s; ?>">
<input type="text" value="<?php echo $o; ?>" >

</body>
</html>

Generate Even Numbers in a Range In PHP.

$start = 1; $end = 20; for ($i = $start; $i <= $end; $i++) {     if ($i % 2 == 0) {         echo $i . " is even.<br>";   ...