//Reverse the number;
let num = 4569;
//Expected Output : 9654
let reverseNum = 0;
while(num>0){
reverseNum = (reverseNum*10)+(num%10);
num=(Math.floor(num/10));
}
console.log(reverseNum); //9654
I understand this question but, I did not understand why “updation” is not required in this question??
New contributor
Tushar Riz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1