

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The solution to a coding problem where you are required to write a program in c to check if a given string is a palindrome or not. The problem statement, the code solution, and the expected output are provided in the document.
What you will learn
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!
TEST CODECoding_2 : TCS Ninja - Total number of question : 1 Test duration (min) : 20 min Correct attempt (mark) : NA Wrong attempt (mark) : NA
Program to check string palindrome. #include <stdio.h> #include <string.h> int main(){ char string1[20]; int i, length; int flag = 0; scanf("%s", string1); length = strlen(string1); for(i=0;i < length ;i++){ if(string1[i] != string1[length-i-1]){ flag = 1; break; } } if (flag) { printf("%s is not a palindrome", string1); } else { printf("%s is a palindrome", string1); }
FACETCS Ninja - Coding_
______________________________________________________________________________________________________Focus Academy for Career Enhancement Page 1 of 2
return 0; }