1-the program must read numeric data from a file.
2-only one line per number
3-half way between those numbers is a negative number.
4-the program must sum those who are above the negative number in a acumulator an those below the negative number in another acumulator.
5-the black screen shall print both results and determined who is grater or equal.
include
include
using namespace std;
void showvalues(int,int,int[]);
void showvalues2(int,int);
void sumtotal(int,int);
int main()
{
int total1=0;
int total2=0;
const int SIZE_A= 9;
int arreglo[SIZE_A];
int suma,total,a,b,c,d,e,f;
ifstream archivo_de_entrada;
archivo_de_entrada.open("numeros.txt");
//lee///
for(int count =0 ;count < SIZE_A;count++)
archivo_de_entrada>>arreglo[count] ;
archivo_de_entrada.close();
showvalues(0,3,arreglo);
showvalues2(5,8);
sumtotal(total1,total2);
system("pause");
return 0;
}
void showvalues(int a,int b,int arreglos)
{
int total1=0;
//muestra////////////////////////
cout<< "los num son ";
for(int count = a ;count <= b;count++)
total1 += arreglos[count];
cout <
}
void showvalues2(int c,int d)
{
//////////////////////////////
int total2=0;
cout<< "los num 2 son ";
for(count =5 ;count <=8;count++)
total2 = total2 + arreglo[count];
cout <
void sumtotal(int e,int f)
{
/////////////////////////////////
cout<<"la suma de t1 y t2 es ";
total= total1 + total2;
cout<
}