Clear[u]
Clear[z]
z[x_, t_] := 
      Sin[((n*Pi*x)/5)]*Cos[((n*Pi*2*t)/5)]
u[x_, t_] = z[x, t] /. n -> 1
Table[
      Plot[u[x, t], {x, 0, 5}, AxesLabel -> {"x", "u(x,t)"}, 
        PlotStyle -> {Thickness[0.02], RGBColor[1, 0, 0]}, 
        PlotRange -> {{-0.5, 5.5}, {-3, 3}}], {t, 0, 18, 
        0.1}]

Clear[u]
Clear[z]
z[x_, t_] := 
      Sin[((n*Pi*x)/5)]*Cos[((n*Pi*2*t)/5)]
u[x_, t_] = z[x, t] /. n -> 2
Table[
      Plot[u[x, t], {x, 0, 5}, AxesLabel -> {"x", "u(x,t)"}, 
        PlotStyle -> {Thickness[0.02], RGBColor[1, 0, 0]}, 
        PlotRange -> {{-0.5, 5.5}, {-3, 3}}], {t, 0, 18, 
        0.1}]

Clear[u]
Clear[z]
z[x_, t_] := 
      Sin[((n*Pi*x)/5)]*Cos[((n*Pi*2*t)/5)]
u[x_, t_] = z[x, t] /. n -> 3
Table[
      Plot[u[x, t], {x, 0, 5}, AxesLabel -> {"x", "u(x,t)"}, 
        PlotStyle -> {Thickness[0.02], RGBColor[1, 0, 0]}, 
        PlotRange -> {{-0.5, 5.5}, {-3, 3}}], {t, 0, 18, 
        0.1}]

Clear[u]
Clear[z]
z[x_, t_] := 
      Sin[((n*Pi*x)/5)]*Cos[((n*Pi*2*t)/5)]
u[x_, t_] = z[x, t] /. n -> 4
Table[
      Plot[u[x, t], {x, 0, 5}, AxesLabel -> {"x", "u(x,t)"}, 
        PlotStyle -> {Thickness[0.02], RGBColor[1, 0, 0]}, 
        PlotRange -> {{-0.5, 5.5}, {-3, 3}}], {t, 0, 18, 
        0.1}]