You are on page 1of 1

clear all

close all
clc
A=input('please enter the value of n')
formula1=A*(2*A+1)*(2*A-1);
C=A*-1;
formula2=C*(2*C+1)*(2*C-1);
F=[1:A];

%;check the boolean condition


if A>=0
% if condition is true then print the following
fprintf('Value is positive' );

formula1
else
fprintf('value is negative');
formula2

end

You might also like