Answer:
#include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string str)
{
char a,b;
int length = str.length();
for (int i = 0; i < length / 2; i++)
{
a=tolower(str[i]);//Converting both first characters to lowercase..
b=tolower(str[length-1-i]);
if (b != a )
return false;
}
return true;
}
int main() {
string t1;
cin>>t1;
if(isPalindrome(t1))
cout<<"The string is Palindrome"<<endl;
else
cout<<"The string is not Palindrome"<<endl;
return 0;
}
Output:-
Enter the string
madam
The string is Palindrome
Enter the string
abba
The string is Palindrome
Enter the string
22
The string is Palindrome
Enter the string
67876
The string is Palindrome
Enter the string
444244
The string is not Palindrome
Explanation:
To ignore the cases of uppercase and lower case i have converted every character to lowercase then checking each character.You can convert to uppercase also that will also work.
You should really state what language you are using. I have produced your method in C#, and should be easily translatable in to any other language.
static void RotateRight<T>(T[] arr)
{
T temp = arr[arr.Length - 1];
for (int i = arr.Length - 1; i >= 0; i--)
{
if (i == 0)
arr[i] = temp;
else
arr[i] = arr[i - 1];
}
}
Answer:
(i) Prevention is more important than detection and recovery.
(ii) Detection is more important than prevention and recovery.
(iii) Recovery is more important than prevention and detection.
Explanation:
(i) Prevention is more important than detection and recovery.
Prevention of attack can be through various applications for example a walk through gates are placed in order to prevent any attacker from entering the premises and causing harm.
(ii) Detection is more important than prevention and recovery.
Detection of an attack can be done through for example a security alarm can detect an attack and inform others.
(iii) Recovery is more important than prevention and detection.
Recovery of an attack can be done by for example an insurance which will recover a portion of loss occurred during the attack.
Answer:
It would be <u>B</u> because They have there own video game system. They will state little good facts about other brands so they seem bias, but they are.
BTW PlayStation is the best... JK they all do the same thing hope this helps!
<u />