C programming language help? [on hold]
So I know you are going to downvote this(rightfully) but please don't,I
really need this and I can't post in stackoverflow because Im banned for
asking stupid questions. So I have to write a program that reverses a two
digits number.I know the code to reverse a GIVEN number which is:
#include "stdio.h"
#include "conio.h"
int main (void)
{
int num, rev = 0, dig;
printf("Enter a number: \t");
scanf("%d", &num);
while(num>0)
{
dig = num % 10;
rev = rev * 10 + dig;
num = num / 10;
}
printf("\nThe reversed numer is: \t%d\n", rev);
getch();
}
But how to change this to a SPecific two digits number?
No comments:
Post a Comment