Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PalindromeDay
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//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; }
g++
22 2 22
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.42 sec, absolute running time: 0.16 sec, cpu time: 0.01 sec, memory peak: 5 Mb, absolute service time: 0,7 sec
edit mode
|
history
|
discussion
Enter Day, Month and Year: The date forms a palindrome.