how do one convert a truth table to boolean equation,I can convert the other way round like below;

//Suppose Z = (A.B + C)'


public class Boolean_to_truth
{



public static void main(.....


{          int    a,b,c,z;
System.out.println("A B C Z");


for(a = 0;a<=1;a++)
for(b = 0;b<=1;b++)
for(c = 0;c<=1;c++)
}
z = ~((a & b|c)  & 1;    //*


System.out.println(a +" "+b+" "+c+" "+ z);


}
}
}

OutPut

A B C Z
0 0  0 1
0 0  1 0
0 1  0 1
0 1  1 0
1 0  0 1
1 0  1 0
1 0  0 0
1 1  1 0

Just want to convert the table back to equation

Your code doesn't make any sense.... It wouldn't compile... and its logic hasn't been preserved.
The equation for Z never changes...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.