C: scanf to array
if (array[0]=1) should be if (array[0]==1). The same with else if (array[0]=2). Note that the expression of the assignment returns the assigned value, in this case if (array[0]=1) will be always true, that’s why the code below the if-statement will be always executed if you don’t change the = to ==. = is the assignment … Read more