943,712 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1070
  • C RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jul 10th, 2008
0

Re: help me plss..

oh oooooooooo, what is it now???

ssharish
Reputation Points: 73
Solved Threads: 20
Posting Whiz in Training
ssharish2005 is offline Offline
253 posts
since Dec 2006
Jul 14th, 2008
0

Re: help me plss..

  1. int main()
  2. {
  3. int i,limit;
  4.  
  5. printf("Enter the Limit: ");
  6. scanf("%d", &limit);
  7.  
  8. printf("%10s%10s%10s", "Number","Square","Cube");
  9.  
  10. for( i = 0; i < limit; ++i ){
  11.  
  12. printf("%10d%10d%10d\n", i, i*i, i*i*i);
  13. }
  14.  
  15. return 0;
  16. }

you can write like that if you want to be formatted for your output, you should glance C I-O chapter...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MustyCE is offline Offline
5 posts
since Jul 2008
Jul 15th, 2008
0

Re: help me plss..

thanks sir.. but now i need another help i want a prgram that continuosly adds the number input then displays the sum when 0 is pressed. all i have is this old code for adding the sum.

  1. #include<stdio.h>
  2. #include<conio.h>
  3. main()
  4. {
  5. int sum,n1,n2,n3,n4;
  6. clrscr();
  7. printf("Enter numbers: ");
  8. scanf("%d%d%d%d",&n1,&n2,&n3,&n4);
  9. sum=n1+n2+n3+n4;
  10. while(1)
  11. {
  12. scanf("%d",&n1);
  13. sum+=n1;
  14. if(n1==0) break;
  15. }
  16.  
  17. printf("\n The sum is: %d", sum);
  18. getch();
  19. }
Reputation Points: 10
Solved Threads: 0
Newbie Poster
trowa0830 is offline Offline
6 posts
since Dec 2007
Jul 15th, 2008
0

Re: help me plss..

Click to Expand / Collapse  Quote originally posted by trowa0830 ...
thanks sir.. but now i need another help i want a prgram that continuosly adds the number input then displays the sum when 0 is pressed. all i have is this old code for adding the sum.
Perhaps you are beyond help. You have been shown some good professional programming practices already. None very hard to understand. But still you go and post an aberration of code, showing your level of commitment to do things right. Am I too harsh coming to that conclusion?
Why don't you go ahead and change that code and implement the suggestions given to you, and prove me wrong.
Last edited by Aia; Jul 15th, 2008 at 6:39 pm.
Aia
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Aia is offline Offline
2,304 posts
since Dec 2006

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: Read from data file at some specified location
Next Thread in C Forum Timeline: Calling external C subroutine from Fortran program





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


Follow us on Twitter


© 2011 DaniWeb® LLC