Structures and Pointers – Strings – Problem #6

IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive

Difficulty: medium

Problem Statement

Input two strings s and t from the user. Assume that the strings do not contain blank or any whitespace character. Write a function that finds if s is a palindrome of t, i.e., whether the reverse of s is equal to t. If it is a palindrome, return 1; otherwise, return 0. The parameters of the function contain only pointers to characters (not arrays): int ispalindrome(char *s, char *t) Do not use any string library functions. In the main function read two strings. Call the above function and print its output.

Back to Lab Problems
Structures and Pointers/Strings/Problem #6

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #6

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.