| | |
help me plss..
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2008
Posts: 5
Reputation:
Solved Threads: 0
C Syntax (Toggle Plain Text)
int main() { int i,limit; printf("Enter the Limit: "); scanf("%d", &limit); printf("%10s%10s%10s", "Number","Square","Cube"); for( i = 0; i < limit; ++i ){ printf("%10d%10d%10d\n", i, i*i, i*i*i); } return 0; }
you can write like that if you want to be formatted for your output, you should glance C I-O chapter...
•
•
Join Date: Dec 2007
Posts: 6
Reputation:
Solved Threads: 0
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.
C Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> main() { int sum,n1,n2,n3,n4; clrscr(); printf("Enter numbers: "); scanf("%d%d%d%d",&n1,&n2,&n3,&n4); sum=n1+n2+n3+n4; while(1) { scanf("%d",&n1); sum+=n1; if(n1==0) break; } printf("\n The sum is: %d", sum); getch(); }
•
•
•
•
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.
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
![]() |
Similar Threads
- Plss Hellppp!!!!! (Viruses, Spyware and other Nasties)
- Help me with this Simple Problem plss (C)
- pls i need help (C)
- Final Yer Projects (Networking Hardware Configuration)
- need help..pls!!! (C++)
- Computer for video editing... (Troubleshooting Dead Machines)
- SLOT MACHINE PROGRAM... Help plsss! (C)
Other Threads in the C Forum
- Previous Thread: Read from data file at some specified location
- Next Thread: Calling external C subroutine from Fortran program
Views: 909 | Replies: 13
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures student suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h






