sujai_249
Newbie level 3
I want to write a code to reverse a number.this is the code i've written..
clc
clear all
n=input('enter any number');
for r=0:n
x(r)=(r*10)+ rem(n,10);
x=n/10;
end
r
the error i am getting is
??? for
|
Error: Incomplete or misformed expression or statement.
In C language the for loop i use is:
for(r=0;n!=0;n/=10)
please help me out
---------- Post added at 05:18 ---------- Previous post was at 05:14 ----------
Also can i give a command like this in matlab:
for r=0n>0)
clc
clear all
n=input('enter any number');
for r=0:n
x(r)=(r*10)+ rem(n,10);
x=n/10;
end
r
the error i am getting is
??? for
|
Error: Incomplete or misformed expression or statement.
In C language the for loop i use is:
for(r=0;n!=0;n/=10)
please help me out
---------- Post added at 05:18 ---------- Previous post was at 05:14 ----------
Also can i give a command like this in matlab:
for r=0n>0)