Monday, 23 December 2013


/*TO CALCULATE THE LENGTH OF THE STRING*/

INPUT

#include<conio.h>
#include<stdio.h>
int main()
{
char str[40];
int i;
printf("\nEnter the string to calculate its string");
gets(str);
for(i=0;str[i]!='\0';i++)
i=i+1;
printf("\nThe length of entered string is: %d",i);
getch();
return 0;
}

OUTPUT



Please give your comment , so I could improve this blog.

Friday, 20 December 2013

/*TO FIND THE SUM OF ENTERED NUMBER USING FUNCTIONS*/


OUTPUT





INPUT

#include<conio.h>
#include<stdio.h>
void sumof()
{
int num,temp,r,sum=0;
printf("Enter a number");
scanf("%d",&num);
temp=num;
while(temp>0)
{
r=temp%10;
sum=sum+r;
temp=temp/10;
}
printf("The sum of entered number is %d",sum);
}
void main()
{
sumof();
}



Wednesday, 27 November 2013

To sort of array using pointer


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

    int main (void)
{
                      clrscr();
                     int item[100];
                     int a,b,t;
                     int count;
                    printf("\nHow many number ?");
                    scanf("%d",&count);
                   for(a=0;a<count;a++)
                      scanf("%d",&item[a]);
                  for(a=1;a<count;++a)
                     for(b=count;b>=a;--b)
                       {
                                if(item[b-1]>item[b])
                               {
                                    t=item[b-1];
                                   t=item[b-1]=item[b];
                                   item[b]=t;
                                    }
                         }
                      for(t=0;t<count;t++)
                     return 0;     
}
OUTPUT



Monday, 4 November 2013

An Introduction Of POINTER In C

POINTER NOTATION :-


  •   Consider the declaration 

              int i =3;

  • This declaration tell c compiler to :-
  1. Reserve space in memory to hold the integer value.
  2. Associate the name i with this memory location .
  3. State the value 3 at this location .
                                  i----------------->location name
                        -------------------->value at location 
                            65524--------------------------------->location number
 void main()
 {

   int i=3;
  printf("\n Address of i=%u",&i);
  printf("\n value of i=%d",i);
  print("\n value of i=%d",*(&i));

 }

    OUTPUT :-
   Address of i=65524
   value of i=3
   value of i=3


  • The '&' used in theis statement is c's address of operators.The expression '&i ' retures the address of variable i,which in this case happens to be 65524.
  • The other pointer available in C is '*, called value at address operator.its gives the value stored at a particlar address .The 'value at address' operator is also called 'Indirectional operator' .

Tuesday, 15 October 2013

What is Computer Software ?

Set of computer programs, procedures and associated documents(flowcharts , manuals) describing the program and how they can be used.
Software package is a group of programs that solve a specific problem or perform a specific task.  Example a word processing package contains programs for text editing, text formatting, drawing graphics, spelling check. Etc 


Types of software
System software
Set of one or more programs which controls the operation and/or extends the processing capability of a computer system.
Its functions are:
Supports development of other application software
Supports execution of other application software
Monitors effective use of various hardware resources like CPU, Memory, peripherals etc
Communicate with and controls operation of printer, disk, tape etc (peripheral devices)
The programs included in a system software package are called system software and programmers who prepare them are called system programmers.


Examples of System software

Operating systems: It takes care of effective utilization of all the hardware and software components of the computer system. Examples of OS are Mac, Windows NT , Ms DOS , MS windows, Linux/Unix.
Programming language translators: are system software that performs the instructions prepared by programmers using convenient programming language into a form that can be interpreted and executed by a computer system.
Utility programs(utilities): are a set of programs that help users in maintenance tasks and in performing tasks of routine nature. Some tasks are Formatting hard disks , searching a particular file from a directory of hundreds of files.


Sunday, 22 September 2013

TO FIND AREA AND CIRCUMFRENCE OF CIRCLE USING C LANGUAGE



//Area And Circumference of circle

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

void main()
{
int r;
float a,c,pi=3.14;
//Enter Radius
printf("\n\nEnter Radius :");
scanf("%d",&r);
//calculating area and circumference
a=pi*r*r;
c=2*pi*r;
//Display
printf("\n\nArea :%f",a);
printf("\n\nCircumference :%f",c);

getch();
}


OUTPUT



TO ADD TWO NUMBER IN C PROGRAM



FILE ->NEW

#include<stdio.h>
#include<conio.h>
void main()
    {
int a,b,c;
scanf("%d%d",&a,&b);
c=a+b;
printf("%d",c)
;
getch();
}


OUTPUT


Tuesday, 27 August 2013



HOW TO MAKE LEAP YEAR FOUNDER IN JAVA USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY





FOR SCRIPT ON CHECK WHEATHER IT IS A LEAP YEAR BUTTON

int y=Integer.parseInt(jTextField1.getText());
       
if (y%4==0&&y%400==0)

jLabel1.setText("It is a leap year ");

else if (y/4!=0)


jLabel1.setText(" It is not a leap year");


Saturday, 17 August 2013

HOW TO MAKE DIFFERENT TYPES OF LOOPS IN JAVA USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY




SCRIPT ON FIRST RADIO BUTTON FROM THE LEFT

int n=Integer.parseInt(jTextField1.getText());           //TO GET THE RANGE OF LOOPING
int i,j;
for(i=1;i<=n;i++)
{for(j=1;j<=i;j++)
     as.append("*");                                                       
     as.append("\n");
                                     //TO PRODUCE OUTPUT IN TEXTAREA
}






SCRIPT ON SECOND RADIO BUTTON FROM THE LEFT

int n=Integer.parseInt(jTextField1.getText());           //TO GET THE RANGE OF LOOPING
int i,j;
for(i=1;i<=n;i++)
{for(j=1;j<=i;j++)
     as.append(j+"");                                                       
     as.append("\n");
                                     //TO PRODUCE OUTPUT IN TEXTAREA
}





SCRIPT ON THIRD RADIO BUTTON FROM THE LEFT

int n=Integer.parseInt(jTextField1.getText());           //TO GET THE RANGE OF LOOPING
int i,j;
for(i=1;i<=n;i++)
{for(j=1;j<=i;j++)
     as.append(i+"");                                                       
     as.append("\n");
                                     //TO PRODUCE OUTPUT IN TEXTAREA
}







Wednesday, 14 August 2013

TO MAX NUMBER BY USE OF CONDITIONAL OPERATORS IN JAVA USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY







SCRIPT FOR FIND MAX BUTTON 


int num1,num2,num3;

int max;

num1=Integer.parseInt(txtnum1.getText());

num2=Integer.parseInt(txtnum2.getText());

num3=Integer.parseInt(txtnum3.getText());

max=((num1>num2)? ((num1>num3)? num1:num3): 
((num2>num3)? num2:num3));
                                                                                            //CONDITIONAL OPERATOR
txtmax.setText(" "+max);


SCRIPT FOR EXIT BUTTON


System.exit(0);


Monday, 12 August 2013

HOW TO CREATE A METHOD AND USE THE SAME TO SWAP  TWO NUMBERS




SCRIPT ON THE BLANK SPACE AFTER CLICK ON SWAP BUTTON

public void swap(int a ,int b)
{
    int c=0;
    c=a;
    a=b;
    b=c;
    jLabel3.setText(""+a);
    jLabel4.setText(""+b);
}

NOTE : 

TAKE TWO LABEL AND NAME THEM AS YOU WISH AND CHANGE THEM IN ABOVE UNDERLINE TEXT.

PLEASE MAKE THE LABEL TEXT CLEAR SO UR RESULT CAN BE DISPLAYED CLEARLY.

YOU CAN ALSO USE TEXT FIELD RATHER THAN LABLE FOR YOUR RESULT.

SCRIPT FOR SWAP BUTTON

            int a=Integer.parseInt(ja.getText());
            int b=Integer.parseInt(jb.getText());
            swap(a,b);

Saturday, 10 August 2013

AVERAGE MARKS , DISTINCSION , GRADE AND TOTAL MARKS     USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY

















SCRIPT FOR COMPUTE BUTTON

// Declare & Initialise variable for storing Subject marks

  int english=Integer.parseInt(txtsc.getText());
 int maths=Integer.parseInt(txtmaths.getText());
 int science=Integer.parseInt(txtsc.getText());
int history=Integer.parseInt(txthist.getText());

//Compute and set total marks
int total =english+maths+science+history;
txttot.setText(" "+total);
//Compute and get Average marks
int average=total/4;
txtavg.setText(" "+average);
//Compute and set Resultand Grade

if (average>=75)
{txtr.setText("Distinction");
txtg.setText("A");}
else if (average>=60)
{txtr.setText("First Class");
txtg.setText("B");}
else if (average>=50)
{txtr.setText("Second Class");
txtg.setText("C");}
else if (average>=40)
{txtr.setText("Average");
txtg.setText("D");}
else
{txtr.setText("Fail");

txtg.setText("F");}


SCRIPT FOR EXIT BUTTON

System.exit(0);                                                            // TO EXIT PROGRAM
HOW TO CREATE A HTML WEBPAGE    USE THE FOLLOWING SCRIPT IN NOTE PAD




OPEN  NOTE PAD AND PASTE THE FOLLOWING SCRIPT

<HTML>
<HEAD>
<TITLE>ONLINE GAMES</TITLE>
</HEAD>
<center>
<body bgcolor="pink" link="green">
<font color="red" face="arial">
<h1>GAMES GALORE</h1>
</center>
</font>
<br>
<br>
<center>
<h2>THE BEST ONLINE GAMES SITE</h2>
</center>
<font face="arial"color="maroon">
<p>WELCOME TO GAMES GALORE....the best online games site.You may view the content within this site using any client browser and you can download games to play them
off-line.</p>
<h2>Featured games:</h2>
<ol type=1>
<a href="ppuzzle.html">
<LI>Puzzle Games
</A>
</LI>
<UL TYPE="square">
<LI>Tetris</LI>
<LI>Cubis</LI></ul>
<A href="card.html">
<LI>Card Games</LI>
</A>
<ol TYPE="i">
<LI>Solitaire</LI>
<LI>Hearts</LI>
</OL>

<a href="action.html">                                       



 SAVE THE FILE WITH EXTENSION .html 
 YOUR FILE WILL SAVE IN SAME BROWSER FILE WHICH YOU USE 
 PREFERRED SAVE IT IN SAME FOLDER ON YOUR DESKTOP  

Friday, 9 August 2013

HOW TO CONVERT TEXT IN DIFFERENT  FONTS    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY




SCRIPT FOR RADIO BUTTON PLAIN

txtjTextField1.setFont(new Font("helvetica",Font.PLAIN,14));


SCRIPT FOR RADIO BUTTON ITALIC


txtjTextField1.setFont(new Font("helvetica",Font.ITALIC,14));


SCRIPT FOR RADIO BUTTON BOLD


txtjTextField1.setFont(new Font("helvetica",Font.BOLD,14));


SCRIPT FOR RADIO BUTTON BOLD/ITALIC


txtjTextField1.setFont(new Font("helvetica",Font.BOLD+Font.ITALIC,14));


SCRIPT FOR  BUTTON EXIT

System.exit(0);


Thursday, 8 August 2013

HOW TO CONVERT TEMPRATURE IN FARANITE  AND CELCIUS    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY




SCRIPT FOR CONVERT BUTTON
        int ch=0;
        if(opt1.isSelected())
        {ch=1;}
        if(opt2.isSelected())
        {ch=2;}
        int f,c;
        double c1=0,f1=0;
        switch(ch)
        {case 1:
             f=Integer.parseInt(txttemp.getText());
             c1=5.0/9*(f-32);
             txtcon.setText(" "+Math.round(c1));
             break;
            case 2:
                c=Integer.parseInt(txttemp.getText());
                f1=1.8*c+32;
                txtcon.setText(" "+Math.round(f1));
                break;
default:
                txtcon.setText("invalid choice!!");

}

SCRIPT FOR EXIT BUTTON

 System.exit(0);
HOW TO CONCAT TWO NAMES    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY




ON THE TOP OF SOURCE PAGE WRITE THE FOLLOWING SCRIPT



  import javax.swing.JOptionPane;


SCRIPT FOR CLICK TO CONCATENATE BUTTON



JOptionPane.showMessageDialog(this,jTextField1.getText()+"  "+jTextField2.getText());


SCRIPT FOR EXIT BUTTON


 System.exit(0);

Wednesday, 7 August 2013

HOW TO MAKE VOWEL FINDER    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY






SCRIPT FOR SUBMIT BUTTON

    String n=jTextField1.getText();
     
   if (n.equals("a"))
    JOptionPane.showMessageDialog(this,n+" is a vowel");

   else if (n.equals("e"))
    JOptionPane.showMessageDialog(this,n+" is a vowel");

         else if (n.equals("i"))
    JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("o"))
    JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("u"))
    JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("A"))
    JOptionPane.showMessageDialog(this,n+" is a vowel type in lower case");

              else if (n.equals("E"))
    JOptionPane.showMessageDialog(this,n+" is a vowel type in lower case");

             else if (n.equals("I"))
    JOptionPane.showMessageDialog(this,n+" is a vowel type in lower case");

             else if (n.equals("O"))
    JOptionPane.showMessageDialog(this,n+" is a vowel type in lower case");

              else if (n.equals("U"))
    JOptionPane.showMessageDialog(this,n+" is a vowel type in lower case");


              else if (n.equals("B"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");



              else if (n.equals("C"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");


              else if (n.equals("D"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");


              else if (n.equals("F"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");


              else if (n.equals("G"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");


              else if (n.equals("H"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("J"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("K"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("L"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("M"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("N"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("P"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("Q"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("R"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("S"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("T"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("V"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("W"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("X"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("Y"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");

              else if (n.equals("Z"))
    JOptionPane.showMessageDialog(this,n+" is a not vowel type in lower case");
       else if (n.equals("b")||n.equals("c")||n.equals("d")||n.equals("f")||n.equals("g")
     ||n.equals("h")||n.equals("j")||n.equals("k")||n.equals("l")||n.equals("m")
     ||n.equals("n")||n.equals("p")||n.equals("q")||n.equals("r")||n.equals("s")
     ||n.equals("t")||n.equals("v")||n.equals("w")||n.equals("x")||n.equals("y")
     ||n.equals("z"))
         
     JOptionPane.showMessageDialog(this,n+" is NOT a vowel");


    jTextField1.setText("");






                                                        ALTERNATIVELY

 String n=jTextField1.getText();
   
         if (n.equals("a"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("e"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("i"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("o"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("u"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("A"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("E"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("I"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("O"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else if (n.equals("U"))
        JOptionPane.showMessageDialog(this,n+" is a vowel");

        else
        JOptionPane.showMessageDialog(this,n+" is NOT a vowel");

         jTextField1.setText("");

Tuesday, 6 August 2013


HOW TO MAKE ODD NUMBER FINDER    USE THE FOLLOWING SCRIPT IN NETBEANS AND CHANGE TEXTFEILD NAME ACORDINGLY





SCRIPT FOR SUBMIT BUTTON

        jTextField3.setText("");
        int num1=Integer.parseInt(jTextField1.getText());
        int num2=Integer.parseInt(jTextField2.getText());
        int i;
        if (num1%2!=0)
        {
            for (i=num1;i<=num2;i+=2)
            txtr.append(i+" ");
        }
        else
        {   for (i=num1+1;i<=num2;i+=2)
            jTextField3.append(i+" "); }


SCRIPT FOR CLEAR BUTTON

        jTextField1.setText("");
        jTextField2.setText("");
        jTextField3.setText("");


SCRIPT FOR EXIT BUTTON


       System.exit(0);