answersLogoWhite

0


Best Answer

C Program to Find Given Number is palindrome or Not palindrome . #include<stdio.h> #include<conio.h> void main() { int rev,num,r1,r2,r3; clrscr(); printf("/n enter values for num"); scanf("%d",&num); r1=num%10; num=num/10; r2=num%10; num=num/10; r3=num; rev=(r1*100)+(r2*10)+(r3*1); if(num==rev) { printf("entre number is palindrome number"); } else { printf("enter number is not palindrome number"); } getch(); }

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

/*******Program for checking a number is PALINDROME or NOT ********/ #include #include void main() { clrscr(); printf("Enter the number = "); scanf("%d",&n); on=n; while(n!=0) { r = n%10; n=n/10; nn=nn*10+r; } if(on==nn) printf("Number is PALINDROME!!!"); else printf("Number is not PALINDROME!!!"); getch(); }

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include <stdio.h>

#include <string.h>

#include < stdlib.h>

int max=0;

int copy(char *str,int n)

{

char *st;

int i;

st=malloc(sizeof(char)*n);

for(i=0;i<=n;i++)

{

st[i]=str[i];

}

st[n+1]='\0';

printf("Palindrome is %s\n",st);

}

int rev(char *s)

{

int j,k,r,len;

len=strlen(s);

for(j=len-1;j>0;j--)

{

k=0;

r=j;

while(k < r && s[k] == s[r])

{

k++;

r--;

}

if(k >= r)

{

//printf("Palindrome Found\n");

if((j+1) > max)

{

max=j+1;

}

copy(s,j);

}

}

}

int palind(char *s)

{

int i,len;

len=strlen(s);

for(i=0;i<len;i++)

{

rev(&s[i]);

}

}

int main()

{

char Sentence[50];

printf("Enter the Sentence\n");

gets(Sentence);

palind(Sentence);

printf("The maximum length is %d",max);

getchar();

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

ksavsak

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find whether an integer array is a palindrome?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write a C Program to fill up an Integer Array?

Reference:cprogramming-bd.com/c_page1.aspx# array programming


What is the sie of an array whos upper bound is 100?

To calculate the size of array the type of array should be given. Ex: if it is of integer type that means int arr[100] and integer is of 4 bytes, then the size of array will be 400 bytes.


Difference between integer array and character array?

Arrays are basic structures wherein one or more elements exist "side by side" and are of the same "type". An "integer" array is an array whose elements are all of an integer type which has no fractional component. A "character" array is an array which contains nothing but character types. A "floating point" array contains elements that have both an integer and fractional portion. Simply put, they are arrays of particular types.


What is integer type array?

An array is a collection of similar data types. An integer array is nothing but a collection of integer data types. Ex: int a[100], int arr[100][100] There are several types. 1D array, 2D array, Multi-Dimensional array. But array is a contiguous allocation. And array size will always be positive. It can be given in the declaration stage or we can specify it dynamically by using malloc function. Ex: int *a; a=(int*)malloc(sizeof(int)*HOW_MANY_NUMBERS_YOU_WANT);


What restriction must be satisfied by all of the data items represented by an array?

An array is a group of related items that share a common name.All these elements are stored consecutively. An array must be declared before its use in the program. Array size must be specified All Array elements must be assigned to any value for assignment the value. Partial initialization of elements of an array is not allowed. Size must be integer constant enclosed within square brackets The name of the array indicates starting address of an array. Each individual element of array is accessed by a subscript.

Related questions

How do you write a C Program to fill up an Integer Array?

Reference:cprogramming-bd.com/c_page1.aspx# array programming


What is the difference between a numericial array and an associative array?

A numericial array is an array with keys made up of only integers. An associative array is an array with keys made up of anything that is not an integer. In some languages, it is possible to mix integer keys and non-integer keys into a mixed array.


What is the sie of an array whos upper bound is 100?

To calculate the size of array the type of array should be given. Ex: if it is of integer type that means int arr[100] and integer is of 4 bytes, then the size of array will be 400 bytes.


Difference between integer array and character array?

Arrays are basic structures wherein one or more elements exist "side by side" and are of the same "type". An "integer" array is an array whose elements are all of an integer type which has no fractional component. A "character" array is an array which contains nothing but character types. A "floating point" array contains elements that have both an integer and fractional portion. Simply put, they are arrays of particular types.


What is integer array in C programming?

An integer array consists of only integer numbers, for instance, if you have the array of size 5 with integer type date int_array[5] it means that your first element int_array[0] is an integer number like 1, or 15 and so on. The same is true for other elements too; int_array[1](int_array[2], int_array[3], int_array[4]) might be any integer element and so on.


How do you write a program that accepts 50 integer values and sort them in basic programming?

Create an array with 50 elements and input the integers one a time, filling the array. Use an insertion sort on the array for each input except the first. Alternatively, input the values first and then use insertion sort.


What is integer type array?

An array is a collection of similar data types. An integer array is nothing but a collection of integer data types. Ex: int a[100], int arr[100][100] There are several types. 1D array, 2D array, Multi-Dimensional array. But array is a contiguous allocation. And array size will always be positive. It can be given in the declaration stage or we can specify it dynamically by using malloc function. Ex: int *a; a=(int*)malloc(sizeof(int)*HOW_MANY_NUMBERS_YOU_WANT);


What are the permissible data types for an array index?

Integer (signed or unsigned)


What restriction must be satisfied by all of the data items represented by an array?

An array is a group of related items that share a common name.All these elements are stored consecutively. An array must be declared before its use in the program. Array size must be specified All Array elements must be assigned to any value for assignment the value. Partial initialization of elements of an array is not allowed. Size must be integer constant enclosed within square brackets The name of the array indicates starting address of an array. Each individual element of array is accessed by a subscript.


What will be the algorithm to input n integers and output the largest one?

var largest : integer largest = array[0] for n : integer in array if n &gt; largest largest = n endif endfor return largest


How do you convert an integer to Boolean array list in java?

You cannot. An Integer is a numeric value whereas a boolean array list is a collection of a number of true or false values. So, you cannot convert either into the other


How do you use in array?

cod a program student degree array in c language