Find the error in the code


#1

Consider the following code fragment.
int n;
float x[1000];
x[i]=(1-2/(n-1))*x[i-1]+2/(n-1)*x[i];
In this fragment, since n is an integer, the division of 2/(n-1) returns an integer value. Which of the following faults is correct?

A)boundary fault
B)initialization fault
C)computation / precision fault
D)all of these


#2

D. All of these

A. Boundary fault will occur if we compute X[0] then there is no -1 index
B. Initialization fault since variables are not initialized they may contain garbage values
C. Computation fault occurs since 2/(n-1) is returning int