Comp242-h43 - #include #include void...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream.h> #include <stdlib.h> void fillArray( int * ar, int size, int inc); void printArray( int * ar, int size); void mergeArrays( int a1[], int size1, int a2[], int size2, int * a3); void shuffle( int * ar, int size); int indexOfMinimum( int ar[], int size); void reverseArray( int * ar, int size); int main() { int ar1[5], ar2[4], ar3[9]; int inc1, inc2; cout << "Enter the first value and increment for ar1: "; cin >> ar1[0] >> inc1; cout << "Enter the first value and increment for ar2: "; cin >> ar2[0] >> inc2; fillArray(ar1, sizeof (ar1)/4, inc1); fillArray(ar2, sizeof (ar2)/4, inc2); cout << endl; cout << "ar1:" << endl; printArray(ar1, sizeof (ar1)/4); cout << endl << endl; cout << "ar2:" << endl; printArray(ar2, sizeof (ar2)/4); cout << endl << endl; mergeArrays(ar1, sizeof (ar1)/4, ar2, sizeof (ar2)/4, ar3); cout << "ar3:" << endl; printArray(ar3, sizeof (ar3)/4); cout << endl << endl; shuffle(ar3, sizeof (ar3)/4); cout << "ar3 after shuffle:" << endl; printArray(ar3,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/18/2010 for the course COMPUTER E Comp242 taught by Professor I.oyman during the Spring '10 term at Koç University.

Page1 / 2

Comp242-h43 - #include #include void...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online