I have the answer to this equation in Pascal. Can anyone help me convert this to c or c ++?
equation: y1+y2+y3+y4=12 yi ≥ 0 , 0 ≤ i ≤ 4

pascal code (but i cant run it) :
program selections3 (input,output);
var
x1,x2,x3: integer;
begin
for x1 :=0 to 12 do
for x2 :=0 to 12 - x1 do
for x3 :=0 to 12 - x1 - x2 do
writlen('x1=',x1-2:0,'x2='x2-2:0,'x3='x3-2:0,'x4=',12-x1-x2-x3-2:0)
end.

The C++ version is: https://onlinegdb.com/HJoukD0D_