Design a C program which reverse the number.
Answers
Answered by
2
Answer:
Enter an integer :1234
Reversed number :4321
Explanation:
#include <stdio.h>
int main()
{
int n, a= 0, c;
clrscr();
printf("Enter an integer: ");
scanf("%d", &n);
while (n != 0)
{
c = n % 10;
a= a* 10 + c;
n /= 10;
}
printf("Reversed number = %d", a);
getch();
return 0;
}
Similar questions
Business Studies,
5 months ago
Math,
5 months ago
English,
5 months ago
English,
10 months ago
Physics,
10 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago