help me plss..

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2006
Posts: 251
Reputation: ssharish2005 is on a distinguished road 
Solved Threads: 20
ssharish2005's Avatar
ssharish2005 ssharish2005 is offline Offline
Posting Whiz in Training

Re: help me plss..

 
0
  #11
Jul 10th, 2008
oh oooooooooo, what is it now???

ssharish
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 5
Reputation: MustyCE is an unknown quantity at this point 
Solved Threads: 0
MustyCE MustyCE is offline Offline
Newbie Poster

Re: help me plss..

 
0
  #12
Jul 14th, 2008
  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...
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 6
Reputation: trowa0830 is an unknown quantity at this point 
Solved Threads: 0
trowa0830 trowa0830 is offline Offline
Newbie Poster

Re: help me plss..

 
0
  #13
Jul 15th, 2008
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. }
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2,048
Reputation: Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of 
Solved Threads: 179
Aia's Avatar
Aia Aia is offline Offline
Postaholic

Re: help me plss..

 
0
  #14
Jul 15th, 2008
Originally Posted by trowa0830 View Post
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.
"If it moves, tax it. If it keeps moving, regulate it, and if it stops moving, subsidize it" - Ronald Reagan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum


Views: 909 | Replies: 13
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC