- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
12 Posted Topics
| |
Re: What problem are you facing with the code? I can some of them. 1) You don't have to calculate the gross pay for everything. Calculating it in the beginning is enough. 2)SocialSecurityTax == rate*40 + 1.5*rate*(hours - 40) - .06*(rate*40 + 1.5*rate*(hours - 40)); There should be only one "=" … | |
Re: First thing, when you call reading function, you pass size variable without initializing. This will not create a problem but bad practice. Second, in the function readin(), you are using ifstream fin but you are not opening any file to read contents. [CODE] void readin(computer * pc , int size) … | |
Re: Can you please explain me what you actually want to do? I mean I know you are trying to find all the prime numbers but why are you starting 4 different threads? | |
Re: [CODE=c] for (i=0;i<3;i++) { for (j=2;j<8;j=j+2) { printf("value of a is %d, value of b is %d",i,j); } } [/CODE] | |
Re: See inline.... You need to have two loops. The outer loop should run from 0,1,2,3.... and the inner loop should run from 2,4,6..... The strategy to achieve this is to set the outer loop to 0 and then run the entire inner loop from 2,4,6... etc. Once the inner loop … | |
Re: While playing with Linked List, you always have to have a pointer pointing to the start of the link. You should not change the pointer at any time during the program. Generally, 'head' is used to point the starting of the linked list. If you do not have a pointer … | |
Re: Initialize the value variable in the function pos_power. This will solve the problem. Check the code below [CODE=c] float pos_power(float base, int exponent) /* Given: A base and exponent * Return: Value of base raised to positive exponent */ { float value=0; // initialize the value variable int i = … | |
Re: In the 'while' condition, you are not changing the 'n' value and that is why it is going in infinite loop. | |
Re: I am assuming that the input is always going to be a whole number and not an integer. I am not providing you with the entire logic. Though I modified your code. You still need to work on it. I am providing comments with the code that might help. I … | |
Re: case 2: list(library[count],count); break; I think the call to the function should be case 2: list(library,count); or list(&library,count); break; |
The End.