From 1ead6575544f370f13015e305c049fd793a0e760 Mon Sep 17 00:00:00 2001 From: Electron-hack <97846362+Electron-hack@users.noreply.github.com> Date: Mon, 24 Oct 2022 17:54:22 +0530 Subject: [PATCH] Create Codeoftheday --- Codeoftheday | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Codeoftheday diff --git a/Codeoftheday b/Codeoftheday new file mode 100644 index 0000000..e38baf9 --- /dev/null +++ b/Codeoftheday @@ -0,0 +1,22 @@ +#include +#include +int main() +{ +char word[100]; +printf("Enter the word to be checked : "); +scanf("%s",word); +//checking if the input is a palindrome +int i=0,j=strlen(word)-1; +int halfword=strlen(word)/2; +for(;ihalfword;i++,j--) +{ +if(word[i]!=word[j]) +{ +printf(" The string ' %s ' is not a palindrome ",word); +break; +} +} +if(i==halfword && j==halfword) +printf("The string %s is a palindrome",word); +returnĀ 0; +}