hi i had a problem in how to implement the loop conditions .the problem is as follows: int num,harray,raaray,rindex; i want to check the condition whether value of num is less than or equal to the values of rarray [i] where i = 0 to rindex .incase this conditon is true i want to increment the value of num to num+1000 ,store the value of this num in haaray.(p.s rindex value is always less than the array size).and call another function called heap Incase the conditon is false for all the values of raaray[rindex] then i want to insert haaray=num and called the function called heap. i have been trying to figure how to write down this code .my code what i have wriiten is as follows but i am not sure whether it is correct or not so please let me know the code is as follows :
The doubt which i have is whether the if conditoin will check for all the i values or not .and i want to go to the assignment portion in the else case only after all the i values have been checked and not satisfied .but i am not sure whether this is implemented in this code which i have wriiten .Please let me know Thanks Lakshmi (edited by Cindy to format code) [ March 07, 2002: Message edited by: Cindy Glass ]
Hello. I am not sure of what you want but what you write will do the test for each value in raaray and will do the 'then' or the 'else' depending on the current value. If you loop 10 times you do the 'if then else' statement tem times. If you want to make it only one time you have to make a loop to test each value then rizing a flag to said all tests failed and outside of the loop making your 'if then else' stament. hope it helps. Bye.
Joined: Nov 08, 2000
hi i want to test for all the values of raaaray[rindex],incase it fails for all the values of rindex then only i want the else part to be executed and not each and every time . I could not understand what u meant by flag also . thanks lakshmi