h=0.1;
c=1;
τ=(h/(2  c));
T=5;
n=Ceiling[20/h];
m=Ceiling[T/τ];
u0[x_]:=({{\[Piecewise], ({{25, x≤0}, {25-25x, 0≤x≤1}, {0, x≥1}})}})
y=Table[0,{n+1},{m+1}];
x=Table[-10+i h,{i,0,n}];
For[i=1, i≤n+1, i++,
y[[i,1]]=u0[x[[i]]]
];
For[j=1, j≤m, j++,
For[i=2,i≤n,i++,
y[[i,j+1]]=(1-c τ/h)y[[i,j]]+c τ/h y[[i-1,j]]
];
y[[1,j+1]]=25;
y[[n+1,j+1]]=y[[n,j+1]];
]

Manipulate[
ListPlot[Table[{x[[i]],y[[i,j]]},{i,1,n+1}]],
{j,1,m+1,1}
]

y[[2]]

τ