Skip to content

Commit

Permalink
In this i have tried character array.
Browse files Browse the repository at this point in the history
  • Loading branch information
bashu22tiwari committed Feb 2, 2021
1 parent 5c7edff commit bad0d44
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Empty file added Character Array/largest.cpp
Empty file.
28 changes: 28 additions & 0 deletions Character Array/palindrome.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// In this we will see whether a string is palindrome is string or not

#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
char array[n+1];
cin >> array ;
int flag=0;
for(int j=0; j<n ; j++)
{
if(array[j]!=array[n-1-j])
{
flag=1;
break;
}
}

if(flag==1){
cout << "Not Palnidrome\n";
}
else
{
cout << "Palindrome\n" ;
}
}
Binary file added Character Array/palindrome.exe
Binary file not shown.

0 comments on commit bad0d44

Please sign in to comment.