online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> void main() { //initialize 3 variable n= original, reversedNumber= number after reversing it //temp variable actas as a helper, used for reversing a number int n, reversedNumber = 0, temp; //Ask the user for number to check printf("Enter a number to check if it is a palindrome or not\n"); //get the user scanf("%d",&n); //save it in temp variable temp = n; //loop until remaining number is not equal to 0 while (temp != 0) { reversedNumber = reversedNumber * 10; reversedNumber = reversedNumber + temp%10; //Get last digit of number by dividing it from 10 which gives remaininder temp = temp/10; } //check if both are same if (n == reversedNumber) { printf("%d is a palindrome number.\n", n); } else { printf("%d isn't a palindrome number.\n", n); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue