Professional Documents
Culture Documents
C Programming
C Programming
Section: B
Semester: 2nd
Solution:
#include <stdio.h>
max = arr[i];
return max;
int main() {
int arr[] = { 3, 7, 2, 9, 5 };
return 0;
Question no.2:
Implement a function to check if a given string is a palindrome. A palindrome is a word,
phrase, or sequence of characters that reads the same backward as forward.
Solution:
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <ctype.h>
int left = 0;
left++;
right--;
if (leftChar != rightChar) {
}
left++;
right--;
int main() {
if (isPalindrome(str1)) {
} else {
if (isPalindrome(str2)) {
} else {
return 0;