close all; clear; clc

x = input("Enter a number: ");

if mod(x, 2) == 0
    x = x / 2;
else
    x = 3 * x + 1;
end

display(x)