0

How to that in c code

Write a program that reads numbers from the user until the number 0 is e tered, and then prints them in reverse order. Do not use arrays in your solution. I try this, but it is not working. https://code.sololearn.com/cBr6wOEQRuKJ/?ref=app

16th Nov 2020, 7:33 AM
Assaf Hillel
Assaf Hillel - avatar
2 Respostas
+ 18
Your code works fine as per your desired output. Try this input: 1234560789 The output will be: 654321
16th Nov 2020, 7:52 AM
Aditya
Aditya - avatar
0
Don't use getchar(), what if you are trying to input 2 or more digits numbers? Here's my version, #include <stdio.h> int main (void) { int v; scanf ("%d", &v); if (v) { main (); printf ("%d\n", v); } return 0; }
17th Nov 2020, 7:49 AM
LastSecond959
LastSecond959 - avatar