Answer:
Using Matlab, the code is here
function p = Sq(side)
a = side*side;
p = 4*side;
fprintf("The area of square is %.2f\\",a);
fprintf("The perimeter of square is %.2f\\",p);
end
while true
side = input("Enter the side of square: ");
Sq(side);
c = input("Do you wish to continue (Y/N) ?", 's');
if c=='n' || c=='N'
break;
end