/*bubblesort routine*/
# include <stdio.h>
# include <stdlib.h>
void bubblesort(int array[],int size);
void main()
{
int values[10],j;
for(j=0;j<10;j++)
values[j] = rand()%100;
/*unsorted*/
printf(“\nUnsorted values.\n”);
for(j=0;j<10;j++)
printf(“%d “,values[j]);
/*sorted*/
printf(“\nSorted values.\n”);
bubblesort(values,10);
for(j=0;j<10;j++)
printf(“%d “,values[j]);
}
Bookmark It
Hide Sites
$$(‘div.d107′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) });
This requires an older operating system and compiler, Turbo C and Windows 98 for example
#include <stdio.h>
#include <dos.h>
#include <stdlib.h>
#include <bios.h>
int main(void)
{
unsigned char buffer[512];
clrscr();
printf(“Insert a blank disk in the A: drive , then press any key.\n”);
/*wait for keypress*
getch();
if(abswrite(0,1,1,&buffer) != 0)
printf(“Cannot write to the A drive.\n”);
else
printf(“Drive A , Sector 1 written to\n”);
return 0;
}
Bookmark It
Hide Sites
$$(‘div.d99′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) [...]
This reads a specified disk sector on a floppy disk
#include <stdio.h>
#include <dos.h>
#include <stdlib.h>
#include <bios.h>
int main(void)
{
unsigned char buffer[512];
clrscr();
printf(“Insert disk in the A: drive , then press any key.\n”);
/*wait for keypress*/
getch();
if(absread(0,1,1,&buffer) != 0)
printf(“Cannot read the A drive.\n”);
else
printf(“Drive A , Sector 1 read\n”);
return 0;
}
This was written using Turbo C and tested on Windows 98
Bookmark It
Hide Sites
$$(‘div.d53′).each( [...]