Q:

Write a program to reverse the number

0

Write c program to reverse the number

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

int n, reverse=0;

printf("Enter a number to reverse \n");
	scanf("%d", &n);
	while(n!=0)
	{
		reverse=reverse * 10;
		reverse=reverse + n % 10;
		n=n/10;
	}
	printf("Reverse of entered number is : %d \n", reverse);

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now