Code Block
#include <stdio.h>
Including standard input output header file
int main()
Main is function from where program starts execution
{
int num = 0, remainder = 0, reverse_num = 0;
Declaration and initializing variables
printf("Enter a number : ");
This message will be printed in the console
scanf("%d",&num);
Input a value
while(num>0)
{
remainder = num % 10;
reverse_num = 10 * reverse_num;
reverse_num = reverse_num + remainder;
num = num / 10;
}
printf("Reversed number : %d", reverse_num);
Output is in the console
return 0;
}
Output Functioning
0
Number
0
0
Remainder
Reverse Number