# C language help"determine palindrome"

This is a discussion on C language help"determine palindrome" within the C Programming forums, part of the General Programming Boards category; please help me out with this coding I need to determine if the set of the number is Palsindrome. Code: ...

1. ## C language help"determine palindrome"

please help me out with this coding I need to determine if the set of the number is Palsindrome.
Code:
```   1     #include <stdio.h>
2
3       int main()
4       {
5
6         int number;
7         int a=/*needed number*/;
8         int x=0;
9         int y=a;
10
11            printf("Enter the set of number:");
12            scanf("%d", &number);
13                 while(z)
14          {
15             x*=10;
16             x+=z%10;
17             z/=10;
18          }
19
20            if(x==a){
21
22               printf("The set of number is a Palindrome");
23
24         }
25
26         else{
27                 printf("The set of number is not a Palindrome");
28
29         }
30           return 0;
31      }```

2. This looks like "homework", which this forum tends to not just "give the answer", but rather tyr to help the poster find the right answer him/herself.

So, my hint is: what is "a" and "y "used for?

--
Mats

3. Originally Posted by shaitan_superma
please help me out with this coding I need to determine if the set of the number is Palsindrome.
Code:
```   1     #include <stdio.h>
2
3       int main()
4       {
5
6         int number;
7         int a=/*needed number*/;
8         int x=0;
9         int y=a;
10
11            printf("Enter the set of number:");
12            scanf("%d", &number);
13                 while(z)
14          {
15             x*=10;
16             x+=z%10;
17             z/=10;
18          }
19
20            if(x==a){
21
22               printf("The set of number is a Palindrome");
23
24         }
25
26         else{
27                 printf("The set of number is not a Palindrome");
28
29         }
30           return 0;
31      }```
Where did u declared 'z'?

4. thats the first time I have seen a poster use the line numbers in the post

5. Read the FAQ, it tells you how to get a number from the user (safely) - find the link yourself. Ensure you've researched how to find if a number is a Palsindrome, then get into coding - don't just dive in.

You should,
* Draw up an IPO chart (Input, Processing, Output) - since you seem a bit confused as to what you need.
* Draw up a flowchart or an NS diagram (research them) - so you can nut out the algorithm

Hand the design in with the solution, even if it's not asked of - usually you can score a couple of marks if the teacher see's you've done it correct in design, but made a mistake in the programming or something.

Have fun.