[++] PROGRAMMING [.net]

- by Abhishek Kumar http://abhikumar163.googlepages.com/

Google
 
Web abhikumar163.googlepages.com
www.download.com www.softpedia.com

Monday, October 16, 2006

Sort an integer array in ascending order

Category : Simple Stuff

Sort an integer array in ascending order


#include
#include
void main(void)


{
int n;//holds the total no. of vals.
int a[100];//Holds the numbers to be sorted
int i,i2,i3,temp,z;//i,i2,i3 & z are loop counters
clrscr();
printf ("Enter the no. of values you want to enter(100 max)>");
scanf ("%d",&n);
for (i=0;ia[i3+1])
{
temp=a[i3];//temp is used to swap a[i3] and a[i3+1]
a[i3]=a[i3+1];
a[i3+1]=temp;
}
clrscr();//this part prints the sorted array.
printf ("Printing sorted array\n");
for (z=0;z

Example of using Menu Style in Java Application

Example of using Menu Style in Java Application just like NotePad



import java.awt.*;
import java.awt.event.*;
class MyMenu


{
Frame f;
MenuBar mb;
Menu m1,m2,m3,m4;
MenuItem mi1,mi2,mi3,mi4;
public MyMenu()


{
f=new Frame("Menu Bar");
mb=new MenuBar();
m1=new Menu("File");
m2=new Menu("Edit");
m3=new Menu("Format");
m4=new Menu("Help");
mi1=new MenuItem("New");
mi2=new MenuItem("Save");
mi3=new MenuItem("Load");
mi4=new MenuItem("Quit");
}
public void launch()


{
mb.add(m1);
mb.add(m2);
mb.add(m3);
mb.setHelpMenu(m4);
m1.add(mi1);
m1.add(mi2);
m1.add(mi3);
m1.addSeparator();
m1.add(mi4);
f.setMenuBar(mb);
f.setVisible(true);
}
public static void main(String a[])


{
MyMenu mm=new MyMenu();
mm.launch();
}
}

Saturday, August 13, 2005

VB And APIs

The API------As everybody knows, an Operating System (OS) acts an interface between the user and the computer. Similarly the Application Programming Interface (API) is nothing but a function interface between the operating system and the application. Using these sweet/stupid functions, we can make our application perform most operations that an operating system can do.

Thursday, April 28, 2005

Get ur queries solved

****** YOU CAN REQUEST ****** ------------------------------------------------------------- For any type of help in programming(in C,C++,VB,etc.) or so in computers you can mail me your questions at < akki16_3@yahoo.com >
or or leave ur Queries here in Comments.
=====================================================================