save values w.r.t variable name correctly,
<?php
if(isset($_POST['submit'])){
$a = $_POST['a'];
$b = $_POST['b']; // here you were saving $_POST['c'] value
$c = $_POST['c'];
$tot = 6;
if(($c + $a + $b) != $tot){
$c = $tot - ($a + $c);
$b = $tot - ($a + $c);
$a = $tot - ($b +$c);
}}?>
solved Learning PHP which had been asked me before [closed]