|
|
|
186
   
Group: Forum Members
Last Login: 17/12/2008 12:02:39
Posts: 112,
Visits: 196
|
|
| just started to learn C programming, and havin some problems, why wont my loop work???? it just loops forever and ever no matter what is entered, tried single and double quotes n now im stuck heres what i got: while(BasicYearlySalary < 5000 || BasicYearlySalary > 20000) { printf("Please Enter the basic yearly salary"); scanf("%d",&BasicYearlySalary); }
Cheers, Myyy Yea!, yea!, yeeeaa!
|
|
|
|
|
Pentium
   
Group: Forum Members
Last Login: Today @ 17:24:57
Posts: 3,012,
Visits: 6,153
|
|
just a thought but is this line correct?
scanf("%d",&BasicYearlySalary)
i just ask because in C++ it should be something like
cin>>input;
but it could just be down to differences in the language
a way to test would be to output the value after its been entered to test that its been inputted correctly
-------------------------------------------------------------------
www.alex3410.com <- updated take a look (29/10/08)
CPU: core2duo E4300 1.8GHz (@2.6GHz), RAM: 2GB corsair XMS2, Gcard: Geforce 7900GS 256MB, Mboard:ASROCK4CoreDual-SATA2, HDD: 1 X 500GB 2X250GB, Monitor:19" acer widescreen

|
|
|
|
|
186
   
Group: Forum Members
Last Login: 17/12/2008 12:02:39
Posts: 112,
Visits: 196
|
|
nah that statements correct m8 it just means load the number(%d) to the addressof(& BasicYearlySalarycan i hav multiple conditions in a for statement if i can how ????
Cheers, Myyy Yea!, yea!, yeeeaa!
|
|
|
|
|
Pentium
   
Group: Forum Members
Last Login: Today @ 17:24:57
Posts: 3,012,
Visits: 6,153
|
|
|
|
|
|
Pentium
   
Group: Forum Members
Last Login: Today @ 17:24:57
Posts: 3,012,
Visits: 6,153
|
|
|
|
|