Skip to content

palindrome.c - #1

Open
smilehacker-max wants to merge 533 commits into
smilehacker-max:masterfrom
vichitr:master
Open

palindrome.c#1
smilehacker-max wants to merge 533 commits into
smilehacker-max:masterfrom
vichitr:master

Conversation

@smilehacker-max

Copy link
Copy Markdown
Owner

#include <stdio.h>
int main() {
int n, reversedN = 0, remainder, originalN;
printf("Enter an integer: ");
scanf("%d", &n);
originalN = n;

// reversed integer is stored in reversedN
while (n != 0) {
    remainder = n % 10;
    reversedN = reversedN * 10 + remainder;
    n /= 10;
}

// palindrome if orignalN and reversedN are equal
if (originalN == reversedN)
    printf("%d is a palindrome.", originalN);
else
    printf("%d is not a palindrome.", originalN);

return 0;

}

vichitr and others added 30 commits October 21, 2019 15:47
Javascript implementation of mergeSort Algorithm
- properly documented
- contains multistep explainations
Solution for a medium level Codechef problem
SURCHESS
(appeared in OCT 18 Long Challange)
Solutions by: Abhishek Tiwari (@become)
anniepineda and others added 30 commits March 5, 2020 17:36
Signed-off-by: vatsa287 <i.mnshreevatsa@gmail.com>
…ay-generators

random int array generators
created Привет, мир
Added Codeforces Problem 996A -  Hit the Lottery in C++
Create 461HammingDistance.java
Added "Print Pretty" and "Rectangle Area"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.