Adeep
2014-05-01 13:45:07 UTC
lets say the size of the input is 100bits. so the user will set the value of "n" which is 100. than the program will access the text file to get the input and manipulate it before storing into an array.
#include
#include
#include
using namespace std;
int main ()
{
// declaring variables:
int j=0,n,a;
double Sobs, prob;
int sum = 0;
cout<<"please input frequency (n) (length of bit string) = " <
int numbers[n];
for (int i = 0; i
ifstream myfile;
myfile.open ("data.txt");
myfile >> a;
j = a*2-1;
numbers[i]=j;
myfile.close();
}
cout<<"\nthe numbers inside the array are : \n\n";
for (int i=0; i
cout<<(numbers[i]);
}