th program i made does not work!!! it should input an integer between 1 and 9. and then output a palindrome.

for example if i input 5, the output should be 123454321.

if i input 1, it should output 1.

and so on...

this is the program i made:

#include <stdio.h>
int main()
{
int n, i;
printf ("Enter digit: ");
scanf ("%d",&n);

if ((n < 0) && (n > 9))
{
printf("number not in range\n");
}


for (i= 1; i <=n; count = i++);
pintf("%d", i);
for(i=n-1; i>=1; i--);
printf(“%d”, i);

return 0;
}

Recommended Answers

All 2 Replies

th program i made does not work!!! it should input an integer between 1 and 9. and then output a palindrome.

for example if i input 5, the output should be 123454321.

if i input 1, it should output 1.

and so on...

this is the program i made:

#include <stdio.h>
int main()
{
int n, i;
printf ("Enter digit: ");
scanf ("%d",&n);

if ((n < 0) && (n > 9))
{
printf("number not in range\n");
}


for (i= 1; i <=n; count = i++);
pintf("%d", i);
for(i=n-1; i>=1; i--);
printf(“%d”, i);

return 0;
}

can somebody help me fix it?

You already have a thread started. You don't need to start many threads on the same topic.

And you neglected to read any of the requested information posted all over this site about CODE tags, like
1) in the Rules you were asked to read when you registered
2) in the text at the top of this forum
3) in the announcement at the top of this forum titled Please use BB Code and Inlinecode tags
4) in the sticky post above titled Read Me: Read This Before Posting
5) any place CODE tags were used, even in responses to your posts
6) Even on the background of the box you actually typed your message in!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.