Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to check if a string is a palindrome.

Easy

Problem Statement

Write a program to check if a string is a palindrome.

Sample Input

str = "madam"

Sample Output

madam is a Palindrome

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <iostream> #include <string> int main() { std::string str = "madam"; // Logic to check if str is a palindrome return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
str = "madam"
Expected Output
madam is a Palindrome