| | |
C program "palindrome"
![]() |
•
•
Join Date: Oct 2009
Posts: 21
Reputation:
Solved Threads: 0
0
#3 Oct 14th, 2009
the problem is that I don't know how to do it. I tried but I don't get it. can somebody help me, my mind is going to blow!!!
0
#7 Oct 14th, 2009
Ok. Consider using two for loops. One to count up to a number and one to count down. Print the looping variable.
0
#9 Oct 14th, 2009
Sorta. But you don't want to nest the loops. printf() after each for loop.
for ( counting up )
printf();
for ( counting down )
printf()
The second loop will be going from the upper limit to 1, remember. So limits of count=n; count>=1; count-- would make more sense.
for ( counting up )
printf();
for ( counting down )
printf()
The second loop will be going from the upper limit to 1, remember. So limits of count=n; count>=1; count-- would make more sense.
•
•
Join Date: Oct 2009
Posts: 21
Reputation:
Solved Threads: 0
0
#10 Oct 14th, 2009
•
•
•
•
Sorta. But you don't want to nest the loops. printf() after each for loop.
for ( counting up )
printf();
for ( counting down )
printf()
The second loop will be going from the upper limit to 1, remember. So limits of count=n; count>=1; count-- would make more sense.
#include <stdio.h>
int main()
{
int n
printf ("Enter digit: ");
scanf ("%d",&n);
if ((n < 0) || (n > 9))
{
printf("number not in range\n");
}
else
for (count = 1; count <=n; count = count + 1);
pintf("%d",count);
for(count=n; count>=1; count = count - 1)
printf(ā%dā, count);
return 0;
}
?
![]() |
Similar Threads
- Hidden program installs .dlls with randomly generated names in random "notify" reg. (Viruses, Spyware and other Nasties)
- google "keyword" question (Search Engine Optimization)
- Need Help. "Macro" program (C)
- Looking for an "Alert" Program (Geeks' Lounge)
Other Threads in the C Forum
- Previous Thread: Random Numbers from 50 t0 250?
- Next Thread: how we use random in C
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o include incrementoperators input interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix meter microsoft motherboard mqqueue mysql number odf open opensource owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling segmentationfault send sequential shape socket socketprograming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h






