forked from harshilp24/Hacktoberfest_2021
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request harshilp24#77 from rashmiee/rashmiee-contribution
Added Palindrome_Word_For Program and Updated Contributors
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
int main() | ||
{ | ||
char c[26]; | ||
int i, j=0, b=0; | ||
printf("Please enter a word below 26 characters : "); | ||
scanf("%s",&c); | ||
|
||
for(i=strlen(c)-1;i>=0;i--) | ||
{ | ||
if(c[i]!=c[j]) | ||
{ | ||
b=1; | ||
break; | ||
} | ||
j++; | ||
} | ||
if(b==0) | ||
printf("\n\tThe word is Palindrome\n"); | ||
else | ||
printf("\n\tThe word is not Palindrome\n"); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters