Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PalindromeDay
//g++ 7.4.0 //Palindrome Day //this code is created by Rezaul Hoque on February03,2022; //contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <iostream> using namespace std; int n=3; int isPalindrome(int [], int ); int isPalindrome(int a[], int n){ int count=0; int i; for (i=0;i<n;i++) if (a[i]==a[n-i-1]) count++; return count; } int main() { int a[n]; cout<<"Enter Day, Month and Year:\n"; for(int i=0;i<n;i++){ cout<<" "; cin>>a[i]; } int result; result=isPalindrome(a, n); if(result==n) {cout<<"\nThe date forms a palindrome.";} else {cout<<"\nThe date does not form a palindrome.";} return 0; }
run
|
edit
|
history
|
help
0
Backpack with recursion
avx2 optimized pcg32 random number generator
cp.cpp
Perf measurement
Dar
ForwardListString2
Sekhejane link
StrStrPbrk
Pointer
base and derr con