c program to check palindrome number or not

list of programs below: c program to check palindrome number or not using functions, c program to check palindrome number or not using for loop, c program to check palindrome number or not using while loop

A number is called palindrome number if reverse of it is equal to same number. Example : 121

C program to check palindrome number or not using functions, for loop while loop
C program to check palindrome number or not using functions, for loop while loop

write a C program to check palindrome number or not using functions

write a C program check palindrome number or not using functions

#include <stdio.h>
#include <conio.h>
void main()
{
int number;
clrscr();
printf(“C program to find a given number is palindrome or not using using functions”);
printf(“enter any no.\n”);
scanf(%d\n”,&number);
Find_Palindrome( number)
getch();
}

//function for palindrome number
void Find_Palindrome(int n)
{
int temp,p,r;
temp=n;
s =0;
for(;n>0;)
{
r=n%10;
p=(p*10)+r;
n=n/10;
}
if(temp== p)
printf(“%d is a palindrome no.”,temp);
else
printf(“%d is not a palindrome no.”,temp);
}

Write a C program to check palindrome number or not using while loop

Write a C program to check palindrome number or not using while loop

#include <stdio.h>
#include <conio.h>
main()
{
int n,temp,s,r;
clrscr();
printf(“C program to check whether a given number is palindrome number or not using while loop”);
printf(“enter any no.\n”);
scanf(%d\n”,&n);
temp=n;
s=0
while(n>0)
{
r=n%10;
s=(s*10)+r;
n=n/10;
}
if( temp== s )
printf(“%d is a palindrome no.”,temp);
else
printf(“%d is not a palindrome no.”, temp );
getch();
}

Write a C program to check palindrome number or not using for loop

write a c program to check palindrome number or not using for loop

#include <stdio.h>
#include <conio.h>
main()
{
int n,temp,s,r;
clrscr();
printf(“c program to find a given number is palindrome or not using for loop”);
printf(“enter any no.\n”);
scanf(%d\n”,&n);
temp=n;
s=0
for(;n>0;n=n/10)
{
r=n%10;
s=(s*10)+r;
}
if( temp== s )
printf(“%d is a palindrome no.”,temp);
else
printf(“%d is not a palindrome no.”, temp );
getch();
}

write a c program to check palindrome number or not using recursion

write a c program to check palindrome string or not using recursion

#include <stdio.h>
#include <conio.h>
//
#include <string.h>
void main()
{
int n;
printf(“c program to check palindrome number or not using recursion \n”);
printf(“Enter a number \n”);
scanf(“%s”,n);
if(n==CheckPalindrome(n))
printf(“The given number is  palindrome”);
else
printf(“The given number is  not a palindrome”);
getch();
}t CheckPalindrome(int num)
{
int a=0,b=0;
if(num!=0)
{
a=num%10;
b=b*10+a;
CheckPalindrome(num/10);
return b;
}

OUTPUT:
c program to check palindrome number or not using recursion
Enter a string
141
The given number is a Palindrome

write a c program to check palindrome number or not using stacks

write a c program to reverse string using stacks

#include<stdio.h>
#include<string.h>
int top=-1;
int stack[5];
void main()
{
int num[5],num2[5],n,m;
int len,i;
printf(“Enter number \n”);
scanf(“%d”,n);
len=o,i=0;
m=n;

while(n>o)
{
num[i]=n%10;
len++;
n=n/10;
}
for(i=0;i<len;i++)
{
push(num[i]);
}
while (len>0)
{
num2[i]=Stack[top];
i++;
pop();
len–;
}

getch();
}

void push(int c)
{
stack[top]=c;
top=top+1;
}

void pop()
{
printf(“%d”, stack[top]);
top–;
}

Other programs:

Static variable scope
Register variable scope
External variable scope
Automatic variable scope
amicable number
Prime number
Perfect number
Palindrome number
Strong number
Find Factorial 
Biggest Number
Average of n numbers
decimal number to octal
convert decimal number to hexadecimal
decimal number to binary
simple interest
compound interest
Add sparce matrices
Add matrices
 file copying
Palindrome string
Reverse string
String length
Replace characters in string
substring or not using arrays
First occurrence of character in string
Last occurrence of character in string
Convert to uppercase
Convert to lowercase
Concatenate strings 
Compare strings
Generate Employee payslips
Count students scoring marks>50%
convert weight into grams

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *