STUDENTS 3K

  • Home
  • Students+
    • Engineering Students
    • Education Loan
    • Study Abroad Guide
    • Projects Download
  • Freshers
    • Aptitude Q & A
    • Placement Papers
    • Verbal Ability
    • Interview Questions
    • IT Company Details
    • Job Updates
  • Study Resources
    • Career Guidance
    • LAB Programs
      • C Programs
      • CPP Programs [C++]
      • Java Programs
    • Question Papers
    • Learn English
    • Notice Board
  • More –>>
    • Love calculator
You are here: Home / Important Programs / Palindrome program in C

Palindrome program in C

C Program : Reverse number and check whether the number is palindrome or not by using unconditional statements.

  • C program for Swapping of two Numbers

Palindrome in C:

A palindrome is a method, which is used to reverse the given numbers. If we reverse a palindrome number, it will not change and it won’t give any other meaning. For example 212, 343, 13431, -525, -767 are palindrome numbers.

[Read: C program for simple interest calculation]

For finding a given number is palindrome or not,

  • Initially we have to reverse it,
  • Then compare the given number with the original palindrome number,
  • If both are same then number is palindrome else not.

[Useful: Education Loan Guide] & [Study Abroad Details]

Here is a C program for finding a palindrome number. The C source code is given below.

/* Title: Palindrome
Author: Vinoth Selvaraj
© http://students3k.com
*/
//Header files
#include <stdio.h>
#include <conio.h>

void main()
{
	//Program variables
	int cnt,temp,vslue,value1,pow=1,value2=1,sum=0;
	clrscr();  //Function to clear the previous output

	printf("Enter the number : "); //Display function
	scanf("%d",&value); //Getting input function
	temp=number;
	// method of reverse number
	while(value>0) //unconditional statement
	{
		value/=10;
		if(value>0) pow++;
	}

	Value=temp;
	value1=value%10;
	while(value>0)
	{
		value=value/10;
		value2=value1*10+sum;
		sum=value%10;
	}
	printf("%d ",value2);
	getch();
}

Filed Under: Important Programs Tagged With: C, LAB, Programs





Random Materials :

  • Data Mining and Data Warehousing
  • Difference Between Class and Primitive Types
  • Database Roles in SQL
  • CASE Expression in SQL
  • Concurrent Update Problem

Follow Us on Facebook

Advertisement

Company Profile

  • About Students3k
  • Contact Us
  • Earn Money Online
  • Website Archive Page
  • Privacy Policy
  • Disclaimer

Categories

  • Important Programs
  • Study Abroad
  • IT Companies
  • Career Guidance for Students
  • Teachers
  • Verbal Analogies

We Are Social

  • Facebook Fans
  • Twitter Follow
  • Google Plus
  • Pinterest Page

© Copyright 2012 - 2016 Students3k.com · All Rights Reserved · Designed By Benefits

Show