943,914 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1103
  • C RSS
Oct 23rd, 2008
0

print 1 to 100 without using forloop

Expand Post »
Hi..

May i have codings 2 display numbers 1 to 100 without using any loop..

Otherwise without using for loop alone...

Thq
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jahira is offline Offline
17 posts
since May 2008
Oct 23rd, 2008
0

Re: print 1 to 100 without using forloop

Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Oct 23rd, 2008
0

Re: print 1 to 100 without using forloop

write a recursive function to print the numbers.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Oct 23rd, 2008
1

Re: print 1 to 100 without using forloop

  1. int i = 1;
  2. STUPID_ASSIGNMENT:
  3. printf("%d\n", i);
  4.  
  5. if(i < 100)
  6. {
  7. i++;
  8. goto STUPID_ASSIGNMENT;
  9. }

Is this the kind of assignment teachers like to give nowadays?
Reputation Points: 118
Solved Threads: 15
Posting Pro in Training
Denniz is offline Offline
428 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Simple program [urgent]
Next Thread in C Forum Timeline: Print Helloworld without using semicolon





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC