cool, sorted that.
Just the end of file thing now.
Its quite strange, when I click the error its going right to the top of the code, inside the #include<stdio.h> line.
I'm sure this is just something silly but any ideas?
Code:
#include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
int codeword_array[20];
int i=0;
int bit;
printf("Welcome to the 5-bit parity code calculator\nPlease enter the 1st bit of the 15 bit codeword now: \n");
for ( i = 0; i<16; i++)
{
scanf("%d", &bit);
if (bit != 0 && bit !=1)
{
printf("All bits must be a 0 or a 1/n");
}
else
{
codeword_array[i] = bit;
}
if (codeword_array[0] + codeword_array[5] + codeword_array[10] == (0||2))
{
codeword_array[15] = 0;
}
else if (codeword_array[0] + codeword_array[5] + codeword_array[10] == (1||3))
{
codeword_array[15] = 1;
}
else
{
printf("Error\n");
}
system("pause");
return 0;
}