
Patrick B. answered 08/28/20
Math and computer tutor/teacher
#include <stdio.h>
void Go()
{
int iNum;
printf(" Input the # :>");
scanf("%d",&iNum);
if (iNum!=-1)
{
Go();
}
printf("%d\n",iNum);
}
int main()
{
Go();
}
Dorsa R.
asked 08/28/20please help me write a program to get numbers until user enters "-1" then prints all the numbers in reverse order .
for exp :
12
14
45
123
-1
prints :
-1 123 45 14 12
PLEASE use recursive functions if possible and without arrays .
Patrick B. answered 08/28/20
Math and computer tutor/teacher
#include <stdio.h>
void Go()
{
int iNum;
printf(" Input the # :>");
scanf("%d",&iNum);
if (iNum!=-1)
{
Go();
}
printf("%d\n",iNum);
}
int main()
{
Go();
}
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.