Printing an array reverse!!!!!!
Hey guys,
I'am trying to print this array backwards i got it to work so it prints out. but i m having trouble wiht my loop to print it out backwards.
#include
using namespace std;
void stars();
void callFunctionNumbers(int array[], int limts, int time);
void counter(int);
void total(int array [][5], int group, int limits);
int main (){
int limitNumber = 5;
int timer = 0;
int array[3][5];
stars();
cout<<"Start of program\n\n";
stars();
callFunctionNumbers(array[0], limitNumber, 0 );
callFunctionNumbers(array[1], limitNumber, 1);
callFunctionNumbers(array[2], limitNumber, 2);
stars();
total(array,0, limitNumber);
total(array,1, limitNumber);
total(array,2, limitNumber);
stars();
stars();
cout<<"In group one location 0 , 1 is "<< array[0][1]<<"\n\n";
cout<<"In group two location 1 , 3 is "<< array[1][3]<<"\n\n";
cout<<"In group one location 2 , 4 is "<< array[2][4]<<"\n\n";
system("PAUSE");
return 0;
}
void stars(){
cout<<"********************************* **\n\n";
}
void callFunctionNumbers(int numbers[], int limits, int timer){
cout<<"Enter five numbers for group "<
I'am trying to print this array backwards i got it to work so it prints out. but i m having trouble wiht my loop to print it out backwards.
#include
using namespace std;
void stars();
void callFunctionNumbers(int array[], int limts, int time);
void counter(int);
void total(int array [][5], int group, int limits);
int main (){
int limitNumber = 5;
int timer = 0;
int array[3][5];
stars();
cout<<"Start of program\n\n";
stars();
callFunctionNumbers(array[0], limitNumber, 0 );
callFunctionNumbers(array[1], limitNumber, 1);
callFunctionNumbers(array[2], limitNumber, 2);
stars();
total(array,0, limitNumber);
total(array,1, limitNumber);
total(array,2, limitNumber);
stars();
stars();
cout<<"In group one location 0 , 1 is "<< array[0][1]<<"\n\n";
cout<<"In group two location 1 , 3 is "<< array[1][3]<<"\n\n";
cout<<"In group one location 2 , 4 is "<< array[2][4]<<"\n\n";
system("PAUSE");
return 0;
}
void stars(){
cout<<"*********************************
}
void callFunctionNumbers(int numbers[], int limits, int timer){
cout<<"Enter five numbers for group "<
[Error: Irreparable invalid markup ('<timer [...] (int>') in entry. Owner must fix manually. Raw contents below.]
Hey guys,
I'am trying to print this array backwards i got it to work so it prints out. but i m having trouble wiht my loop to print it out backwards.
<lj-cut text="Read more">
#include<iostream>
using namespace std;
void stars();
void callFunctionNumbers(int array[], int limts, int time);
void counter(int);
void total(int array [][5], int group, int limits);
int main (){
int limitNumber = 5;
int timer = 0;
int array[3][5];
stars();
cout<<"Start of program\n\n";
stars();
callFunctionNumbers(array[0], limitNumber, 0 );
callFunctionNumbers(array[1], limitNumber, 1);
callFunctionNumbers(array[2], limitNumber, 2);
stars();
total(array,0, limitNumber);
total(array,1, limitNumber);
total(array,2, limitNumber);
stars();
stars();
cout<<"In group one location 0 , 1 is "<< array[0][1]<<"\n\n";
cout<<"In group two location 1 , 3 is "<< array[1][3]<<"\n\n";
cout<<"In group one location 2 , 4 is "<< array[2][4]<<"\n\n";
system("PAUSE");
return 0;
}
void stars(){
cout<<"***********************************\n\n";
}
void callFunctionNumbers(int numbers[], int limits, int timer){
cout<<"Enter five numbers for group "<<timer + 1<<"\n";
for (int i = 0; i < limits; i++)
cin >> numbers[i];
stars();
}
void total(int array[][5],int groupNumber,int limits){
cout<<"for group number "<<groupNumber + 1<<"\n\n";
for( int i = 0; i < limits ; i++){
cout<< array[groupNumber][i];
cout<<"\n";
}
}
I know it will look similar to the function total,
</lj-cut>
thank you
chris
I'am trying to print this array backwards i got it to work so it prints out. but i m having trouble wiht my loop to print it out backwards.
<lj-cut text="Read more">
#include<iostream>
using namespace std;
void stars();
void callFunctionNumbers(int array[], int limts, int time);
void counter(int);
void total(int array [][5], int group, int limits);
int main (){
int limitNumber = 5;
int timer = 0;
int array[3][5];
stars();
cout<<"Start of program\n\n";
stars();
callFunctionNumbers(array[0], limitNumber, 0 );
callFunctionNumbers(array[1], limitNumber, 1);
callFunctionNumbers(array[2], limitNumber, 2);
stars();
total(array,0, limitNumber);
total(array,1, limitNumber);
total(array,2, limitNumber);
stars();
stars();
cout<<"In group one location 0 , 1 is "<< array[0][1]<<"\n\n";
cout<<"In group two location 1 , 3 is "<< array[1][3]<<"\n\n";
cout<<"In group one location 2 , 4 is "<< array[2][4]<<"\n\n";
system("PAUSE");
return 0;
}
void stars(){
cout<<"***********************************\n\n";
}
void callFunctionNumbers(int numbers[], int limits, int timer){
cout<<"Enter five numbers for group "<<timer + 1<<"\n";
for (int i = 0; i < limits; i++)
cin >> numbers[i];
stars();
}
void total(int array[][5],int groupNumber,int limits){
cout<<"for group number "<<groupNumber + 1<<"\n\n";
for( int i = 0; i < limits ; i++){
cout<< array[groupNumber][i];
cout<<"\n";
}
}
I know it will look similar to the function total,
</lj-cut>
thank you
chris
