POST YOUR C++ PROGRAMS iR ! SiMPLE ->

View previous topic View next topic Go down

POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by deathrowcore on Mon Nov 09, 2009 4:24 pm

POST IR
anything that can help our young IT's to improve their skills.
for example...
fibonacci sequence
sorting algorithm


here's an example

bubble sort code


#include <iostream>

using namespace std;


int compare(int, int);

void sort(int[], const int);

void swap(int *, int *);


int compare(int x, int y)

{

return(x > y);

}


void swap(int *x, int *y)

{

int temp;

temp = *x;

*x = *y;

*y = temp;

}


void sort(int table[], const int n)

{

for(int i = 0; i < n; i++)

{

for(int j = 0; j < n-1; j++)

{

if(compare(table[j], table[j+1]))

swap(&table[j], &table[j+1]);

}

}

}


int quantity;

int* tab;


int main()

{

cout << "Input quantity: ";

cin >> quantity;

tab = new int [quantity];

cout << "Input numbers: \n\n";

for (int i = 0; i < quantity; i++)

{

int x = i;

cout << "#" << ++x << ": ";

cin >> tab[i];

}


cout << "\nBefore sorting: ";

for (int i = 0; i < quantity; i++)

{

cout << tab[i] << " ";

}


cout << "\nAfter sorting: ";

sort(tab, quantity);

for(int i = 0; i < quantity; i++)

{

cout << tab[i] << " ";

}

return 0;

}


Last edited by deathrowcore on Sat Nov 14, 2009 9:24 am; edited 1 time in total
avatar
deathrowcore
Newbie

Male
Posts : 17
Age : 25
Joined date : 2009-10-29
Location : pampanga
Cash : 13994

Back to top Go down

Re: POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by L'Jyen [♥] on Tue Nov 10, 2009 2:43 pm

the programmed program??

like a program of a survey?
is it like that?

specify please..
avatar
L'Jyen [♥]
DPC Elite

Female
Posts : 4910
Age : 23
Joined date : 2009-10-26
Location : in lala-land x]]
Cash : 19254

http://kawaii610.webs.com

Back to top Go down

Re: POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by lovebang01 on Tue Nov 10, 2009 8:57 pm

aray
avatar
lovebang01
DPC Addict

Male
Posts : 166
Age : 24
Joined date : 2009-10-26
Location : Bacolod City
Cash : 14198

http://friendster.com/admerbakud

Back to top Go down

Re: POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by XED on Tue Nov 10, 2009 9:01 pm

^ oops.. spam yan!

kindly specify ur subject pls.
we don't understand ee..


avatar
XED
Global Moderator
 Global Moderator

Male
Posts : 6137
Age : 107
Joined date : 2009-10-22
Location : sa bag mo :]]
Cash : 18567

Back to top Go down

Re: POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by L'Jyen [♥] on Wed Nov 11, 2009 9:16 am

if yer looking for Compilers/IDE's of C/C++ click here
or
all tools for progrmming in different languages
click here

kindly specify it for us
to understand it well..
thanks^^
avatar
L'Jyen [♥]
DPC Elite

Female
Posts : 4910
Age : 23
Joined date : 2009-10-26
Location : in lala-land x]]
Cash : 19254

http://kawaii610.webs.com

Back to top Go down

Re: POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by jhennyz on Sat Mar 06, 2010 7:11 pm

*

this is an example code for a C++ program...
___

thanks for sharin this..

for a better reading purposes...

u can ease the space by using

[c0de][/c0de]..

it can maximize tha space ur using..

i know codes are long..^^
avatar
jhennyz
DPC Addict

Female
Posts : 148
Age : 25
Joined date : 2010-03-04
Location : ~NOWHERETOFiND~
Cash : 14001

Back to top Go down

Re: POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by Null on Mon Mar 08, 2010 8:53 am

check the title please...only post c++ codes.. Thank you
avatar
Null
DPC Guest
DPC Guest

Male
Posts : 625
Age : 26
Joined date : 2009-10-29
Location : Regina Parquez's Heart
Cash : 14189

Back to top Go down

Re: POST YOUR C++ PROGRAMS iR ! SiMPLE ->

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum