![]() |
|
#1
|
||||
|
||||
for looping probI'VE TRIED THE FOR LOOPING AS BELOW, BUT THE OUTPUT I'VE GOT DIDN'T APPEAR AS I WANT. I THINK THERE'S SOMETHING WRONG WITH THE LOOP CONDITION. ANYBODY THERE CAN HELP ME. THANKS IN ADVANCE
the source code: CPP / C++ / C Code:
the output i1[0]j[0]: 5.100000 i2[0]j[0]: 5.100000 i1[0]i2[0]: 5.100000 i1[0]j[1]: 3.500000 i2[0]j[1]: 3.500000 i1[0]i2[0]: 5.100000 i1[0]j[2]: 1.400000 i2[0]j[2]: 1.400000 i1[0]i2[0]: 5.100000 i1[0]j[3]: 0.200000 i2[0]j[3]: 0.200000 i1[0]i2[0]: 5.100000 i1[1]j[0]: 4.900000 i2[1]j[0]: 4.900000 i1[1]i2[1]: 3.000000 i1[1]j[1]: 3.000000 i2[1]j[1]: 3.000000 i1[1]i2[1]: 3.000000 i1[1]j[2]: 1.400000 i2[1]j[2]: 1.400000 i1[1]i2[1]: 3.000000 i1[1]j[3]: 0.200000 i2[1]j[3]: 0.200000 i1[1]i2[1]: 3.000000 i1[2]j[0]: 4.700000 i2[2]j[0]: 4.700000 i1[2]i2[2]: 1.300000 i1[2]j[1]: 3.200000 i2[2]j[1]: 3.200000 i1[2]i2[2]: 1.300000 i1[2]j[2]: 1.300000 i2[2]j[2]: 1.300000 i1[2]i2[2]: 1.300000 i1[2]j[3]: 0.200000 i2[2]j[3]: 0.200000 i1[2]i2[2]: 1.300000 i1[3]j[0]: 4.600000 i2[3]j[0]: 4.600000 i1[3]i2[3]: 0.200000 i1[3]j[1]: 3.100000 i2[3]j[1]: 3.100000 i1[3]i2[3]: 0.200000 i1[3]j[2]: 1.500000 i2[3]j[2]: 1.500000 i1[3]i2[3]: 0.20000 |
|
#2
|
||||
|
||||
|
What output were you hoping for?
The second loop (the first nested loop) won't even run the first time(while i1 = 0). Maybe thats where your problem comes in.That means first time var1 is set its gonna equal: var1 = A[1][0] - A[0][0] the second time its gona be A[1][1] - A[0][1] and so on. If this is what you want you could just leave the second loop out and put: CPP / C++ / C Code:
__________________
"To argue with a person who has renounced the use of reason is like administering medicine to the dead." -Thomas Paine www.sullivan-county.com/deism.htm |
Recent GIDBlog
Prepping for deployment by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help/advise on HDD prob | [Ci] Luigi | Computer Hardware Forum | 9 | 28-Aug-2004 14:52 |
| Prob. w/ Initalizing Data Members to 0 | BobbyMurcerFan | CPP / C++ Forum | 5 | 26-Jun-2004 20:01 |
| writing into file prob | belludandy | C Programming Language | 0 | 15-Nov-2003 19:25 |
| vector prob | nattylife | CPP / C++ Forum | 1 | 15-Nov-2003 07:41 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The