Sunday 30 September 2012

Change Browser Title & Get The Current page URL Using Java Script

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Girfa......</title>
    <script language=javascript>
        function tit()
        {

            top.document.title=document.forms[0].t1.value;       
        }
        function geturl()
        {
            alert(document.URL);          
        }
       
        function tmp()
        {
            alert();           
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
   
        Enter Title :
        <input type="text" id="t1" />
        <input type=button value="Change Title " onclick="tit()" />
        <br />
        <br />
         <input type=button value="Get URL " onclick="geturl()" />                   
    </form>
</body>
</html>

Picture Gallery Using Java Script With Fade Effect Change

Picture Gallery is use to show picture on a website.When there are
more than one picture has to be show then we use picture gallery
Which change pictures automatically.I'm here make a picture
gallery which change automatically with fade effect.I have save
my all picture on my current project and renamed them 1,2,3.....n
I want give credit of this gallery to http://www.cryer.co.uk

HTML Code...

<html >
<head >
    <title>Girfa Photo Gallery Demo</title>
    <script type="text/javascript">


Picture Album Auto Change Using Java script

Picture album is very important part of the web development
mostly developer  attached their organization picture on website.We see these pictures change
automatically.I always want to do this,after searching many website i got a simple
solution to  make it. Their are many standard way to achieve it. But my solution is tricky..
If you have fix number of image on your site then my code is useful for you, I renamed all my image
into serial number 1,2....... n
I used Timer on every tick of timer i changed the image's relative path
HTML Code...
 <html >
<head >
    <title>Girfa Album Timer Demo</title>

Web Page History Using Java Script

history Object

Contains information about the URLs visited by the client.
For security reasons, the history object does not expose the actual URLs in the browser history. It does allow navigation through the browser history by exposing the back, forward, and go methods. A particular document in the browser history can be identified as an index relative to the current page. For example, specifying -1 as a parameter for the go method is the equivalent of clicking the Back button.

 <a href='javascript:history.go(-1)'>Back to the previous page</a>

Jump one page back according to history  

<script language=javascript>
        function goForward()
        {
            history.go(1)
        }
    </script>

<input id="Button1" type="button" value="Next" onclick="goForward()" />

Act as forward button

 

Navigation with Java Script Open Function


Mostly we navigate on different using <a></a> tag you can navigate on different pages
Using Java script window.open function which you a lot of option with navigation.. 
Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the sUrl parameter and the sName parameter to collect the output of the write method and the writeln method.
Syntax
oNewDoc = document.open(sUrl [, sName] [, sFeatures] [, bReplace])

Java script Interaction with server in ASP.NET

java script is a alanguage which runs on client machine
but we can interact with server in asp.net
Server returns data and it catch by java script functions and rebder
data as you have hanldle it.Its prevent full page paost back..My example will show
random number in textbox generated by server.

Friday 28 September 2012

Validation Controls in ASP.net

ASP.Net provides validation controls which a rich amount
of validation services that saves your work to make
java script code because at a huge level java script is used to validate client side
validation. for perform validation using java script you must have knowledge of
java script.
But you can perform powerful validation using ASP.net Validation
Controls with knowledge of java script..

RequiredFieldValidator Control

Evaluates the value of an input control to ensure that the user enters a value.
Use the RequiredFieldValidator control to make an input control a mandatory field. The input control fails validation if the value it contains does not change from its initial value when validation is performed. This prevents the user from leaving the associated input control unchanged. By default, the initial value is an empty string (""), which indicates that a value must be entered in the input control for it to pass validation.

Controls :
  • Textbox
  • ASP Button
  • Requirefield Validater
  • Label
Property :
         RequiredFieldValidator
  • ControlToValidate="TextBox1"
  • ErrorMessage="*" 
Aspx page code 
<form id="form1" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
            ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>

<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Save" />
<asp:Label ID="Label1" runat="server"></asp:Label> 
</form>

Server Side code :
protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = "Running Server code";
    }


RangeValidator Control 


Evaluates the value of an input control to determine whether it is between the specified upper and lower boundaries.
The RangeValidator control allows you to check whether a user's entry is between a specified upper and a specified lower boundary. You can check ranges within pairs of numbers, alphabetic characters, and dates. Boundaries are expressed as constants.

Print a character in Notepad,Excel,Power Point using ASCII code

Notepad is windows platform text editor.
You can enter value in notepad within a ASCII range
but You can also provide input using ASCII code
because keyboard has not all key which can print all ASCII Code
Steps 
  • Press ASCII character with alt key
  • make sure num lock is on
  • because you can provide ASCII only using numeric key......

How to make Numeric,String textbox and many more on a webpage using java script

Here i'm showing code which help you to make
a textbox which can only accept number.
This is helpful when you're making texbox which takes number as input
This solution works in both IE and Mozilla.
Numeric  Textbox..
HTML Code :
<html>
<head >
    <title>Girfa Numeric Textbox Demo</title>
   
    <script language="javascript">
        function validatenumber(evt)
        {
           
          var ch = (evt.which) ? evt.which : event.keyCode
          if(ch > 31 && (ch < 48 || ch > 57))         
            return false;
                   
          return true;                     
            
        }

Thursday 27 September 2012

How to make popup menu in VB 6.0

Hi...
Popup menu is menu which appeared when we right click from mouse
on a form. You can see it when you right click on desktop a menu appeared
which is pop menu.
There're many uses of popup menu in windows development
Popup menu provide many flexible option front of user its really make
an application more user friendly because user choose their option frequently


   as you can see in image that you must make a menu and make it visible property false
otherwise it'll not appear on form.
You have to visible it on mouse right click . So we can use form mouse up event.
For Detect right click button of mouse you can use Button value which initialize by event handler
if button value is 2 then its rdenotes right click otherwise 1 if user clicked on left button
Now you can make its visibility true as in code....

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
        PopupMenu mnedit
    End If
 
End Sub

How to print background color and image on paper in word 2003 and 2007

In default setting of word you can't print background color and image of
a page on a paper.But you can do it by changing some property take a look

Print Background color,image in word 2007
  • Select word option from Office button
  • Select Display
  • Check Print background colors and images
  • Click ok

Change case of text in Excel 2003 and Excel 2007

There'are many situation when we want change case of text in excel after data entry.
There may a huge amount of text within a column which you want to  change.
you can use excel function upper,lower and proper how? Take a look..

Change Text Case in excel 2007




  • Enter your text As in image
  • select column near of your text cell as in image
  •  If There is not  space for a column then right click select insert and add entire column
  • Enter Formula as you want apply
      e.g. =upper(b1) 
      drag it down side
  • Now Select change text and copy it
  • Click on cell where actual change has to be done
  • Highlight Home from ribbon control select paste and pick paste values
  • Now you can delete column which had add...

Tree Using Opration Using C language

Tree

a tree is a widely used data structure that simulates a hierarchical tree structure with a set of linked nodes.
A tree can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of nodes (the "children"), with the constraints that no node is duplicated. A tree can be defined abstractly as a whole (globally) as an ordered tree

Menu based program for tree operation (Add,Delete,inorder,preorder,postorder print).

#include<stdio.h>
#include<conio.h>
/* Tree Implementation
   By Girfa
   Do not use it on any other website
   */
typedef struct st_tree
{
    struct st_tree *left;
    int data;
    struct st_tree *right;
}tree;
/* Function Prototype */
tree* create(int);
void insert(int n,tree **);
void inorder(tree *);
void preorder(tree *);
void postorder(tree*);
void del(int,tree **);
void main()
{
    tree *root=NULL;
    int n,s,opt;

Wednesday 26 September 2012

HIDDEN PROGRAME IN WINDOW XP

Is it strange to hear , but true that some good programs are hidden in Windows XP !!!


Programs :

1. Private Character Editor :

Used for editing fonts,etc.
** start>>Run
** Now, type eudcedit

2. Dr. Watson :

This an inbuilt windows repairing software !
** start>>Run
** Now, type drwtsn32

3. Media Player 5.1 :

Even if you upgrade your Media Player, you can still access your old player in case the new one fails !!!
** start>>Run
** Now, type mplay32

4. iExpress :

Used to create SetupsYou can create your own installers !
** start>>Run
** Now, type iexpress

Tuesday 25 September 2012

Double Link List Using C Language

Double Link List..

a doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes. The beginning and ending nodes' previous and next links, respectively, point to some kind of terminator

Advantage

A doubly linked list can be traversed in both directions (forward and backward). A singly linked list can only be traversed in one direction. 

A node on a doubly linked list may be deleted with little trouble, since we have pointers to the previous and next nodes. A node on a singly linked list cannot be removed unless we have the pointer to its predecessor.
On the flip side however, a doubly linked list needs more operations while inserting or deleting and it needs more space (to store the extra pointer).
Implementation: Complete menu base code
#include<stdio.h>
#include<conio.h>
/*   Double Link List Example
     Developed By Girfa
     do not use it on any other website
*/
typedef struct st_dlist
{
struct st_list *pre;
int data;]
struct st_list *next;
}dnode;
/* Function Prototype */
dnode * create(int);
void addbegin(int,dnode**,dnode**);
void addlast(int,dnode**,dnode**);
void addbefore(int,int,dnode**,dnode**);
void addafter(int,int,dnode**,dnode**);
void del(int,dnode**,dnode**);
void print(dnode*);
void main()
{
dnode *head=NULL,*tail=NULL;
int n,s,opt;

Queue Using Single Link List Using C Language

Queue

a queue is a particular kind of abstract data type or collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position and removal of entities from the front terminal position. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed.

Queue Implementation Using Single link list

#include<stdio.h>
#include<conio.h>
/* Queue Implementation using single link list
   Develop By Girfa
   do not use it on any other website
*/
typedef struct st_que
{
int data;
struct st_que *next;
}que;
/* Function Prototype */
que* create(int);
void enque(int,que **,que **);
void deque(que**,que**);
void print(que*);

Stack Operation using C Language


Stack......
a stack is an area of memory that holds all local variables and parameters used by any function
One way of describing the stack is as a last in, first out (LIFO)
The push operation adds a new item to the top of the stack, or initializes the stack if it is empty
 If the stack is full and does not contain enough space to accept the given item, the stack is then considered to be in an overflow state. The pop operation removes an item from the top of the stack. A pop either reveals previously concealed items, or results in an empty stack, but if the stack is empty then it goes into underflow state (It means no items are present in stack to be removed)


Stack Operation Using Single Link List 

#include<stdio.h>
#include<conio.h>
typedef struct st_stack
{
int data;
struct st_stack *next;
}stack;
/* Function Prototype */
stack* create(int);
void push(stack**,int);
void pop(stack**);
void print(stack*);
void main()
{
stack *start=NULL;
int n,s,opt;

Monday 24 September 2012

Singal Link List Operation using C Language


In computer science, a linked listis a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of a datum and a reference (in other words, a link) to the next node in the sequence; more complex variants add additional links. This structure allows for efficient insertion or removal of elements from any position in the sequence.
#include<stdio.h>
#include<conio.h>
typedef struct st_tag
{
int data;
struct st_tag *next;
}node;
/* Function Prototype */
node* create(int);
void addbegin(node**,int);
void addlast(node**,int);
void addbefore(node**,int,int);
void addafter(node**,int,int);
void del(int,node**);
void print(node*);
void main()
{
node *start=NULL;
int n,s,opt;

Saturday 22 September 2012

Database operation ASP.net using SQL Server 2000


The ADO.NET architecture is designed to make life easier for both the application developer and the database provider. To the developer, it presents a set of abstract classes that define a common set of methods and properties that can be used to access any data source. The data source is treated as an abstract entity, much like a drawing surface is to the GDI+ classes.


Controls :
  • Three Textbox
  • Three Button
  • One GridView
  • SqlDataSource




Setting Gridview : 
  • Add Gridview select auto format if you want to use available style for gridview select a style click ok
  • Choose data source select < New Data source.. >
  • Select Database from Configuration Wizard 
  • Click New Connection and change database type from Add Connection wizard
  • Choose SQL Server click ok
  • Enter Server name I have have used . for local client server
  • Select Database Click ok
  • Select check your connection string and click next
  • Select your table and fields which you want to show on Gridview
Coding :
 SqlConnection con;
    SqlCommand com;
    protected void Page_Load(object sender, EventArgs e)
    {
        con = new SqlConnection("initial catalog=bsw;data source=.;integrated security=true");
        com = com = new SqlCommand();
        com.Connection = con;
    }

Timer In ASP.Net Using AJAX

With the help of AJAX we can postback an specific  part of a web part.
Normally when we click on a control which has capability to postback its load entire
page which time and data consuming both.You can save your time and data cost both
With Ajax
Controls..

  • ScriptManager
  • UpdatePanel
  • Timer
  • Label
ASP Source code *.aspx


<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
            </asp:Timer>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
Server side code *.aspx.cs


public partial class _Default : System.Web.UI.Page
{
    static int i;
    
    protected void Timer1_Tick(object sender, EventArgs e)
    {
        i++;
        Label1.Text = i.ToString();
    }
}

How to make search box on your web site


Google provide a custom search box which make you able to
search content on your website with the help of Google custom search box
just paste this code on your website where you want to place it...........

<form action="http://www.google.com/cse" id="cse-search-box" target="_self">
  <div>    
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="25" /><br />
    <input type="submit" name="sa" value="Search" class="formoutput"/>
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

Friday 21 September 2012

Database Operation in Visual C#

Controls
  • Three TextBox
  • Three Button
  • One Data GridView


Setting DataGridView..
  • Click Datagridview task An Arrow right top side of Gridview
  • Choose Data Source
  • Add Project Data Source
  • Select Database from Configuration Wizard Click Next
  • Click New Connection Click change from add connection wizard,select Microsoft Access Database file from  change data source wizard click ok
  • Browse your database mdb file from your computer, Test Connection > Ok >click next from configuration wizard
  • Visual studio prompt you to add your database in current project if you want to add click yes otherwise on
  • Select table from configuratiob wizard select your table and check fields which you want show in Datagridview and finish




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace AccessDemo
{
    public partial class Form1 : Form
    {
        OleDbConnection con = new OleDbConnection(@"provider=microsoft.jet.oledb.4.0;data source=D:\Raj\c#\Database\bsw.mdb");
        OleDbCommand com = new OleDbCommand();
        public Form1()
        {
            try
            {
                con.Open();
                com.Connection = con;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            InitializeComponent();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtRoll.Text == "" || txtName.Text == "" || txtCity.Text == "")
            {
                MessageBox.Show("Please fill all field properly");
            }
            else
            {
                             
                try
                {
               
                    com.CommandText = "insert into stu values(" + txtRoll.Text + ",'" + txtName.Text + "','" + txtCity.Text + "')";
                    com.ExecuteNonQuery();
                    MessageBox.Show("saved");
                    this.stuTableAdapter.Fill(this.bswDataSet.stu);

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
         

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'bswDataSet.stu' table. You can move, or remove it, as needed.
            this.stuTableAdapter.Fill(this.bswDataSet.stu);

        }

RollOver Feature on an Image in your website

Rollover is a feature in this effect when you move mouse on a
image then image change on that button instantly.This is possible with the help combination
of java script and css using inline mode



     <img src=a1.jpg height=100px width=100px
        onmouseover="this.src='a2.jpg'"
        onmouseout="this.src='a1.jpg'" />

   <img src=a1.jpg height=100px width=100px
        onmouseover="this.src='a2.jpg';this.style.border='outset 5px blue'"
        onmouseout="this.src='a1.jpg';this.style.border=''" />
     

RollOver and RollOut Effect on Button in a Website


<input type="button" value=" Girfa : Student Help " id="b1"    
      onmouseover="this.style.fontWeight='bold';"
      onmouseout="this.style.fontWeight='normal'";
      />


<input type="button" value=" Girfa : Student Help " id="b1"
      style="background-color:'blue'"
      onmouseover="this.style.backgroundColor='aqua';"
      onmouseout="this.style.backgroundColor='blue'";
      />



<input type="button" value="Girfa : Student Help"
      onmouseover="this.style.color='Blue';this.style.backgroundColor='yellow';this.style.border='outset 3px red'"
      onmouseout="this.style.color='';this.style.backgroundColor='';this.style.border=''" />


DLL in VB 6.0,VB.Net,C#

Hi......
DLL statds for Dynamic Link Library which comprise Business logic .At A huge level of 
Software development it is suitable to implement business login separately. 
DLL provides facility of reversibility means  ones you have been created a DLL 
for a task then many project can use your DLL, Like if you have a DLL of
Calculator logic then many Application can use it after importing DLL ij their project...

DLL in VB 6.0
  • Open VB 6.0 and select ActiveXdll
  • Change your final project name as you're going to make otherwise you may be face problem of name contradiction because default name of dll project is Project 1 and VB Standard exe has also same so change name of dll project or standard exe project
  • On Project explorer window change of class1 as your requirement
  • now make some procedure and function of your logic as showing in following picture
  • Save DLL project
  • For make DLL select File > Make Project1 DLL...
  • Now your DLL is ready to use
Develop by Raj Kumar

How to use This DLL
  • Open VB 6.0
  • Select Standard EXE
  • For add a DLL in your project ..
  • Go to Project > Refereneces.
  • Browse Your DLL File and click open
  • Now you can use DLL class
  • Make an object of class which you have made in your DLL project
  • Call function of your DLL class using . operator
After import DLL you can use it at anywhere here is code which you can use on a button click event

Private Sub Command1_Click()
    Dim ob As New Class1
    ob.Show
    
End Sub

Private Sub Command2_Click()
    Dim ob As New Class1
    MsgBox (ob.Sum(10, 20))
End Sub
DLL in C# and VB.Net

  • Open Visual studio 2008 File > Project > Select class library form template
  • Implement your function and logic inside class body
  • After implementing logic press f6 for build your DLL Project
  • For use a DLL in windows Application right click of root folder from solution explorer
  • Add References..
  • Browse your project DLL
  • Now make an object of class which you have named in DLL file
Code of DLL my DLL file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
    public class Class1
    {
        public int sum(int a,int b)
        {
            return a + b;
        }
    }
}

Thursday 20 September 2012

Zig Zag Effect on text and image using MARQUEE


Marquee is a  HTML tag which is use scroll object inseide it.
You can scroll any thing in body of marquee. Marquee tag has property direction which moves
and object(left,right,up,down) , Behavior property change behavior of scrolling.....
You can put image instead of <h1> or any thing which you want to move in a zigzag way... Enjoy marquee.

Girfa : Student Help

<marquee behavior=alternate>
        <marquee direction=down behavior=alternate>
            <marquee direction=up behavior=alternate>
                <h1>Girfa : Student Help</h1>
            </marquee>
        </marquee>       
   </marquee>

Database connectivity with MS Access in VB 6.0


Database connection with VB 6.0
VB provides a rich set of of database connectivety.Most of work which is needed done by aotomatically.There’re some control which provides database connectivety.Here i’m going to implement it using ADODB.
ADODB provides connection class.which handle insert ADODB,update,delete operation efficiently.
Ø       Make an objet of ADODB,Connection
Ø       Then call open function which takes connection string as argument
Ø       Connection string comprise database enzine name and your database path.I have supply relative path my database is in current folder.


Maked by Raj kumar

Controls :
    ( Three label,,Three Moniter,Three  textbox )

Coding

Dim con As New ADODB.Connection

Private Sub btnDelete_Click()
    If txtRoll.Text = "" Then
        MsgBox "Please enter roll no."
        txtRoll.SetFocus
    Else
        If MsgBox("Are you sure to delete this record", vbYesNo, "Girfa") = vbYes Then
            con.BeginTrans
            con.Execute "delete from stu where roll=" & txtRoll.Text
            con.CommitTrans
            txtRoll.Text = ""
            MsgBox "Record deleted"
        End If
        
    End If
End Sub

Private Sub btnSave_Click()
    If txtRoll.Text = "" Or txtName.Text = "" Or txtCity.Text = "" Then
        MsgBox "Please Fill alll field"
    Else
        con.BeginTrans
        con.Execute "insert into stu values(" & txtRoll.Text & ",'" & txtName.Text & "','" & txtCity.Text & "')"
        con.CommitTrans
        MsgBox "Saved", , "Girfa"
        
    End If
End Sub

Private Sub btnUpdate_Click()
    If txtRoll.Text = "" Or txtName.Text = "" Or txtCity.Text = "" Then
        MsgBox "Please enter all field value"
    Else
        con.BeginTrans
        con.Execute "update stu set name='" & txtName.Text & "',city='" & txtCity.Text & "' where roll=" & txtRoll.Text
        con.CommitTrans
        MsgBox "Record has been updated", , "Girfa"
    End If
End Sub

Private Sub Form_Load()
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=bsw.mdb;Persist Security Info=False"
End Sub



Wednesday 19 September 2012

How to Print New Line in VB 6.0 Message Box


Message box is form which is use to print a message
by default its print text in same line
but you print your text in new line...... howz????
take a look..........
Private Sub Command1_Click()
    MsgBox "    Girfa " & vbCrLf & "Student Help", , "Girfa"
End Sub


Timer Using Java Script


We use timer control in VB6.0 ,VB.Net's window application.You can implement it in your web page using
java script.

Setting a timeout is done using the window’s setTimeout() method. This method accepts two arguments:
the code to execute and the number of milliseconds (1/1000 of a second) to wait before executing it. The
first argument can either be a string of code (as would be used with the eval() function) or a pointer to a
function. For example, both these lines display an alert after one second:



When you call setTimeout(), it creates a numeric timeout ID, which is similar to a process ID in an
operating system. The timeout ID is essentially an identifier for the delayed process should you decide,
after calling setTimeout(), that the code shouldn’t be executed. To cancel a pending timeout, use the
clearTimeout() method and pass in the timeout ID:



<html >
<head >
    <title>Girfa Timer Demo</title>
    <script language=javascript>
        var i=0;
        var id;
        function sstart()
        {
            var ob=document.getElementById('s1');
            i++;
            ob.innerHTML=i;
            id=setTimeout("sstart()",1000);          
        }
        function tstop()
        {
         
          clearTimeout(id);
         
        }
        function tstart()
        {
            setTimeout("sstart()",1000);
        }
    </script>
 
</head>
<body onload="sstart()">
    <form>
             <span id="s1" style="font-size:x-large">0:0:0</span>
            <input type=button value="start" onclick="tstart()" />
            <input type=button value="stop" onclick="tstop()" />
    </form>
</body>
</html>




Modal Question and Programming C Language

Practical Question paper of C Language

Loop


Miscellaneous

One Dimension Practical model question paper

Q 1. Write a  program to shift array element with previous one (Left-Sifting) . Last element will replace with first element ?

Q 2. Write a program to count even and odd number in an array?

Q 3.Write a program to make three array name mArry, even & odd move array value in even & odd array respect to this type ?

Q 4.Write a program to find smallest and highest number from an array?

Q 5. Write a program to print an array in reverse order?

Q 6. Write a program to print only consecutive number of an array?

Q 7. Write a program to implement union and intersection?

Q 8. Write a program to merge two array into a single array?

Q 9.Write a program to spilt an array into two equal parts ?

Q 10. Write a program to input Fibonacci into array?

Q 11.Write a program to find out prime number between given range and saved these number into array. Range should be up-to 1 to 10000 ?

Q 12.Write a program to input 10 numbers and print each element with multiply by its equivalent index position?

Q 13. Write a program to print an array value without using loop ?

Q 14.Write a program search a number in array ?

Q 15.Write a program to print an array value skip by one index?

Q 17. Write a program to input ASCII value and print its equivalent character.Using 7 bit ASCII/

One Dimension Character Array  Programs

1. Write a program to count Vowels and consonant?

2. Write a program to count no. of word in an array?

3. Write a program to convert lower case character into upper case

4. Write a program to print only consecutive appeared character

5. Write a program to implement concatenation?

6.  Write a program to implement substring function type functionality without using library function.

7. Write a program to input small letter if capital letter is there ignore that

8. Write a program accept any case input and convert it small case

9. Write a program input character only and display error message on any other input?

10. Write a program to search a substring and print its index

11. Write a program to search a word and reverse that

12. Write a program implement encryption i.e. change each character to two character forward. i.e.   A-> C,B->E

13. Write a program to implement following format
              G                                              GIRFA
              GI                                             GIRF
              GIR                                          GIR
              GIRF                                        GI
              GIRFA                                     G

14. Write a program to implement abbreviation i.e.
Input : Ashok Kumar Yadav
Output : A.K. Yadav

15. Write a program to implement find and replace all functionality

16. Write a program to check whether a string is palindrome or  not

17. Write a program reverse a string

18. Write a program to reverse each word into array

19. Write a program to input string password. i.e.(A Small and Capital character , A number and a special symbol)

20. Write a program to check validity of an email address. (an email can have only one @ symbol after that . is required and no space is allowed)

21. Write a program count frequency of each character individually.
22. Write a program to convert number to word?
   i.e.    123
            One Hundred Three Only


Prime Number

#include<stdio.h>
void main()
{
int i,j,k;
printf("Enter number>> ");
scanf("%d",&i);
j=2;
while(j<i)
{
if(i%j==0)
break;
j++;
}
if(i==j)
printf("Prime");
else
printf("Not Prime");
}

Reverse A number

#include<stdio.h>
void main()
{
int i,j,k,m=0;
printf("Enter number>> ");
scanf("%d",&i);
k=i;
while(i>0)
{
j=i%10;
i=i/10;
m=m*10+j;

}
printf("Reverse number is %d",m);
}
Armstrong Number

void main()
{
int i,j,k,m=0;
printf("Enter number>> ");
scanf("%d",&i);
k=i;
while(i>0)
{
j=i%10;
i=i/10;
m=m+j*j*j;

}
if(k==m)
printf("\nArmstrong");
else
printf("\nNot Armstrong");
}

Fibonacci Series


#include<stdio.h>
void main()
{
   int a,b,c;
  c=1;
  a=0;
  b=0;
   while(c<200)
   {
   a=b;
   b=c;
  c=a+b;
  printf("%d\t",a);
   }
}

Factorial number using Recursive function

       #include<stdio.h>
       int fact(int n)
      {
   if(n==0)
  return(1);
   else
  return(n*fact(n-1));
      }
      void main()
     {
    int a;
    printf("enter a number>> ");
    scanf("%d",&a);
    printf("\n\tFactorial=%d",fact(a));
    }
Print your name without using semicolon

     #include<stdio.h>
     void main()
    {
       if(printf("Hello Girfa"))
          {
          }
    }

Palindrome

A palindrome is a word, phrase, number, or other sequence of units that may be read the same way in either direction, with general allowances for adjustments to punctuation and word dividers.

/* Without Using Library function */
void main()
{
    char nm1[20],nm2[20];
    int i,j;
    printf("Enter your text>> ");
    gets(nm1);
       for(i=0;nm1[i]!='\0';i++);
    /* Assine first string in second in reverse order */
      for(i--,j=0;i>=0;i--,j++)
        nm2[j]=nm1[i];

    /* Checking whether both're same or not */
       for(i=0;nm1[i]!='\0';i++);
    for(j=0;nm1[j]==nm2[j] && nm1[j]!='\0';j++);
    if(j==i)
        printf("Palindrom");
    else
        printf("Not Palindrom");
}

/* Using Library String.h function
void main()
{
    char nm1[20],nm2[20];
    int i,j;
    printf("Enter your text>> ");
    gets(nm1);
    strcpy(nm2,nm1);
    strrev(nm2);
    if(strcmp(nm1,nm2)==0)
        printf("Palindrom");
    else
        printf("Not Palindrom");
  }

Multiplication of 2D Array (Matrix)

#include<stdio.h>
#define row 2
#define col 2
void main()
{
/* *********Multiplication Rule ***********
  First Arrar Column must be same as Second Array row
  otherwise multiplication can't take place
  By Girfa
*/
int a[row][col],b[row][col],cc[row][col],r,c,k,sum=0;
clrscr();
printf("\n*****Enter Data for first Array*****\n");
for(r=0;r<2;r++)
{
for(c=0;c<2;c++)
{
printf("Enter [%d][%d]'st number>>  ",r+1,c+1);
scanf("%d",&a[r][c]);
}
}
printf("\n*****Enter Data for Second Array*****\n");
for(r=0;r<2;r++)
{
for(c=0;c<2;c++)
{
printf("Enter [%d][%d]'st number>>  ",r+1,c+1);
scanf("%d",&b[r][c]);
}
}
for(r=0;r<2;r++)
{
for(c=0;c<2;c++)
{
cc[r][c]=0;
}
}
for(r=0;r<2;r++)
{
for(c=0;c<2;c++)
{

  for(k=0;k<2;k++)
  {
sum=sum+a[r][k]*b[k][c];
  }
  cc[r][c]=sum;
  sum=0;
}
}
clrscr();
printf("\n***** first Array*****\n");
for(r=0;r<2;r++)
{
for(c=0;c<2;c++)
{
printf("\t%d",a[r][c]);
}
printf("\n");
}
printf("\n***** Second Array*****\n");
for(r=0;r<2;r++)
{
for(c=0;c<2;c++)
{
printf("\t%d",b[r][c]);
}
printf("\n");
}
printf("\n***** Result *****\n");
for(r=0;r<2;r++)
{
for(c=0;c<2;c++)
{
printf("\t%d",cc[r][c]);
}
printf("\n");
}
getch();

Tuesday 18 September 2012

How to connect word document to MS Access database

HI............
word is a software which is used to process word but you can save record in access.
Using word for doing this you will have to use control box from Toolbar.
After getting control box, Take control which you want...
I'm using 3 textbox and 1 button in my example




Now double click on your button . VB coding window will appeared.
For database connectivity I have use ADODB class.
you need to  add   a reference of  this class otherwise you can't use this.
for add reference in vb coding window click
Tools>references
Select Microsoft ActiveX Data Object 2.6 Library

Start and Stop Marquee using mouseover and mouseout event and News Ticker

Hi.... this is raj..........
Marquee is a HTML tag which is use to scroll an object over a page.
There are many direction (left,right,alternate). Where object moves.You can stop
and start a marquee using java script.Marquee object has methods start and stop.
Which are respectively used to start and stop a marquee.
Copy and paste following example save with .htm or .html extention...


<html>
<head>
<title>Girfa : Java Script Marquee Demo </title>
<script language="javascript">
function stopM()
{
var ob=document.getElementById('m1');
ob.stop();
}
function startM()
{
var ob=document.getElementById('m1');
ob.start();
}
</script>
</head>

<body>
<div style="height:210px;width:210px;border:outset 3px blue"">
<marquee onmouseover="stopM()" id="m1"
onmouseout="startM()" >
<a href="a.jpg"><img src="a.jpg" height=200px width="200px">
<a href="b.jpg"><img src="b.jpg" height=200px width="200px">
</marquee>
</div>
</body>
</html>