943,879 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 2209
  • C RSS
Jun 2nd, 2007
0

Product Of Even numbers [HELP]

Expand Post »
Hiz well i m new in here n i m goin to have exam after 3 days i got stuckd in a question
Q) Write a program to print the product of even numbers.....

plz i m new with c langauge n i m having final exam jst after 3 DAys
thnx
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mnmustafa is offline Offline
11 posts
since Jun 2007
Jun 2nd, 2007
0

Re: Product Of Even numbers [HELP]

What code have you written so far?
Reputation Points: 62
Solved Threads: 10
Junior Poster
jim mcnamara is offline Offline
179 posts
since May 2004
Jun 2nd, 2007
0

Re: Product Of Even numbers [HELP]

Actually i havent started yet......i saw the question in exercise n i didnt found any example in my book....so thats y i asked it here
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mnmustafa is offline Offline
11 posts
since Jun 2007
Jun 2nd, 2007
0

Re: Product Of Even numbers [HELP]

This will show the even integers between 2 and limit, then it is up to you to show the product:
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int x;
  6. int limit = 30;
  7.  
  8. for(x = 2; x <= limit; x=x+2)
  9. {
  10. printf("%d\n", x);
  11. }
  12.  
  13. getchar(); // wait for enter
  14. return 0;
  15. }
Reputation Points: 625
Solved Threads: 211
Posting Virtuoso
Ene Uran is offline Offline
1,704 posts
since Aug 2005
Jun 2nd, 2007
0

Re: Product Of Even numbers [HELP]

Thankyou
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mnmustafa is offline Offline
11 posts
since Jun 2007
Jun 4th, 2007
0

Re: Product Of Even numbers [HELP]

but tis showing 143254346436 lolz ,..........i mean some numbers.......
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mnmustafa is offline Offline
11 posts
since Jun 2007
Jun 4th, 2007
0

Re: Product Of Even numbers [HELP]

Post your code.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Jun 6th, 2007
0

Re: Product Of Even numbers [HELP]

well after this u only have to print the product so create a new variable long prefferably to store x*x and print tht outside the loop
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sweetleaf is offline Offline
7 posts
since May 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

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: A chal;lenging debugging problem : NEW
Next Thread in C Forum Timeline: 2D array allocation problem





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


Follow us on Twitter


© 2011 DaniWeb® LLC