+ 5
C program to find reverse of a number
I develop a code but it does not give the correct output if I enter 000
15 ответов
+ 9
Go through this Code:
In this Code ,the number is Reversed and then compare with original number.
https://code.sololearn.com/cLcUlmlu081P/?ref=app
+ 8
000 is obviously converted to 0.
+ 3
What are you getting if you input 000?
+ 3
It depends on your logic.
If you want that case also, you have take input 000 as a string or character literals..
+ 3
Geya Shibu
If you reverse a number it is okay that 000 return 0.
If you use Strings than "000" should return "000".
+ 3
You should write extra case for 000
+ 2
👩💻ROHIT KANOJIYA👩💻
Yes this is the code for reverse of the number. It is correct for all numbers. But check the input 000
The output will be only 0
+ 1
Just one 0
+ 1
Didn't you get any other better combination of numbers to test your code?
+ 1
I'm trying to ask whether it is giving right output for other combinations?
And share your code first.
+ 1
OkkJaya krishna
+ 1
Okk.👍Thank you
0
Why? A program should satisfy every inputs..
0
Ohh sorry. Yes it work for other combination. I will share the codeAvinesh
0
Geya Shibu When your input is 000.
Check the final value that you are printing, it will have only 0. So you will never get the desired result with numeric data types.