0% found this document useful (0 votes)
34 views10 pages

Zealpolytechnic: Micro Project

This document describes a micro project on developing a C program to check if a given string is a palindrome or not. It explains the algorithm to reverse the input string and compare it to the original to determine palindrome status, and includes the program code and conclusions.

Uploaded by

yashraj shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views10 pages

Zealpolytechnic: Micro Project

This document describes a micro project on developing a C program to check if a given string is a palindrome or not. It explains the algorithm to reverse the input string and compare it to the original to determine palindrome status, and includes the program code and conclusions.

Uploaded by

yashraj shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

ZEAL EDUCATION SOCIETY’S

ZEALPOLYTECHNIC
MICRO PROJECT
Academic year: 2023-24

Programming in C (PIC)
Palindrome Checker

……………………………………………
……………………………………………

Program: CO Program code:312303

Course: PIC Course code: 312303


Group Details:
Sr. No Name of Roll No Enrollment No Seat No
group
members

1)
2)
3)
4)
5)

Name of Guide: - Dipali Gupta


Zeal Polytechnic Narhe, Pune

Course: PIC Course code: 312303


INDEX
SR.NO. CONTENT PAGE NO.

Course: PIC Course code: 312303


PROJECT ABSTRACT

The Palindrome Checker project in C aims to develop a simple yet efficient program to
determine whether a given string is a palindrome or not. A palindrome is a word, phrase,
number, or other sequence of characters that reads the same forward and backward. The
proposed solu on u lizes a string reversal technique, where the input string
is reversed and then compared with the original string to check for equality. The program is
designed to handle both single-word and mul -word palindromes, disregarding spaces,
punctua on, and case sensi vity. Through this project, learners can gain insights into string
manipula on, condi onal statements, and algorithmic thinking in the C programming
language.

Course: PIC Course code: 312303


CONTENT

Dry Run Explaining the algorithm:

Take input ‘n’. Let us take n=141


Keep a copy of n in orgNum i.e. orgNum=141
1st itera on while(n!=0) i.e. while(141!=0)
Remainder = n % 10 i.e. remainder = 141 % 10 hence remainder = 1
revNum = revNum * 10 + remainder i.e. reverse = 0*10+1 hence
revNum = 1 n = n / 10 i.e. n = 141 / 10 hence n = 14

2nd itera on while(n!=0) i.e. while(14!=0)


Remainder = n % 10 i.e. remainder = 14 % 10 hence remainder = 4
revNum = revNum * 10 + remainder i.e. revNum = 1 * 10 + 4 i.e. reverse = 10 + 4 hence
revNum = n = n / 10 i.e. n = 14 / 10 hence n = 1

3rd itera on while(n!=0) i.e. while(1!=0)


Remainder = n % 10 i.e. remainder = 1 % 10 hence remainder = 1
reversedNum = reversedNum * 10 + remainder i.e. reverse = 14 * 10 + 1 i.e. reverse
= 140 + 1 hence reversedNum = 141
n = n / 10 i.e. n = 1/10 hence n = 0

While Loop ends here as n=0.


Check if the IF condi on is sa sfied.
If(originalNum==reversedNum) i.e. if(121==121)
The condi on is true.
Hence the number is a palindromic number

Course: PIC Course code: 312303


Course: PIC Course code: 312303
CONTENT

#include<stdio.h>

int main()
{

int sum,rem,rev=0 ,temp,n;

prin ("enter a no");

scanf("%d",&n);
temp=n;

while(n!=0){
rem=n%10;
rev=rem+10*rev;
n=n/10;
}

if(temp==rev){

prin ("it is palindrome");


}

else{

prin ("it is not palinddrome");


}

return 0;
}

Course: PIC Course code: 312303


CONCLUSION

In conclusion, the Palindrome Checker project in C demonstrates the efficient use of


string manipula on and logical opera ons to determine whether a given input is a
palindrome. By implemen ng this project, one gains a be er understanding of string
handling in C and reinforces fundamental programming concepts such as loops and
condi onals. Addi onally, it serves as a prac cal exercise in problem-solving and
algorithmic thinking.

Course: PIC Course code: 312303


WEEKLY PROGRESS REPORT
MICRO PROJECT

SR.NO. WEEK ACTIVITY PERFORMED SIGN OF GUIDE DATE

1 1st Discussion and finalization of topic

2 2nd Preparation and submission of Abstract

3 3rd Literature Review

4 4th Collection of Data

5 5th Collection of Data

6 6th Discussion and outline of Content

7 7th Formulation of Content

8 8th Editing and proof Reading of


Content

9 9th Compilation of Report And Presentation

10 11th Viva voce

11 12th Final submission of Micro Project

Sign of the student Sign of the Faculty

Course: PIC Course code: 312303


Course: PIC Course code: 312303

You might also like