We didnt do much C++ because its my first year yet he expects for us to make a full code to sort positive , negative , par and impar variables
heres my code so far
#include <iostream>
using namespace std;
int list[50];
int tab[10] ={3, 6, 9, 1, 4, 7, 8, -8, -69, -45},n = 10, i;
void InputData(int n)
{
int i;
for(i=0; i < n; i++){
cout<<"["<<i+1<<"]: ";
cin>>list[i];
}
}
void SortData(int n)
{
cout <<"pare =";
for(i=0; i < n; i++) {
cout << tab[i];
if(i<n-1)
cout << ",";
}
cout>>endl
}
cout <<"impare =";
for(i =0; i < n; i++);
if (tab[i] % 2 !=0){
cout << ",";
cout<<endl;
cout<<"pozitive =";
for (int i =0; i < n; i++)
if (tab[i] > 0)
cout << tab[i] << ","
cout<<endl
}
void ShowData(int n)
{
int i;
for(i=0; i<n; i++)
cout<<list[i]<<endl;
}
int main(void)
{
int n;
cout <<"quantity of numbers: ";
cin>>n;
// define needed variables
InputData(n);
//sort data input
SortData(n);
//show sort data
ShowData(n);
return 0;
}
yet i dont know how to make it work