C Program to reverse the digits of an number

Sample Input 1 :

734

Sample Output 1 :

347

Flow Chart Design

C Program to reverse the digits of an number Flow Chart

Program or Solution

				
			
					
#include<stdio.h>
int main()
{
	int num,rev,rem;
	scanf("%d",&num);
	while(num!=0)
	{
		rem=num%10;
		rev=rev*10+rem;
		num/=10;
	}
	printf("Reverse is %d",rev);
	return 0;
}
		
			
				
			

Output

C Program to reverse the digits of an number Output

Program Explanation

refer video tutorial