Forum: C Feb 18th, 2009 |
| Replies: 2 Views: 395 Well, we are not supposed to do your homework, but here is some code you can use as starting point. So, the code for the recursive input:
void readA(int A[]){
if (nr>0) {
... |
Forum: C Oct 22nd, 2008 |
| Replies: 4 Views: 502 I've compiled and run it without problems;
Enter the number corresponding to ... : 1
Please enter the number of ... : 40
Output:
Gross Pay - 365.50
Payable Tax - 58.10
Net Pay - 307.40
Which... |
Forum: C Oct 22nd, 2008 |
| Replies: 2 Views: 418 You could try a double variable, like this:
for (float c=0.0;c<2.1;c+=0.02) {
...
}
Inside that for, you compute the values for your function, then you save these... |
Forum: C Aug 13th, 2008 |
| Replies: 11 Views: 1,904 Right... If he/she cannot even describe what the problem is...;) |
Forum: C Aug 13th, 2008 |
| Replies: 11 Views: 1,904 How do you store the information? (I mean in the memory, in a text file, database?) Different solutions for different approaches... And also, you should post some code, so we can help you without... |
Forum: C Aug 12th, 2008 |
| Replies: 3 Views: 846 As far as I can remember, a c header file cannot contain implementation, only functions' signature. You declare your functions and constants in the header file. The implementation is done in that... |
Forum: C Aug 12th, 2008 |
| Replies: 6 Views: 640 Well,
static means (at least in Java, but I think it's the same) that you don't need to create an instance of that class, you can access that method directly: ClassName.methodName([params]).
void... |
Forum: C May 31st, 2008 |
| Replies: 7 Views: 1,035 Use Lex and Yacc (or Bison) to make your life easier. |
Forum: C Jun 15th, 2007 |
| Replies: 8 Views: 6,717 Just an idea:
Two words are usually separated by " "(SPACE). So, you have a string, containing some words. Now you start from the end of the string, and put the character into a new string's 0th... |
Forum: C Jun 15th, 2007 |
| Replies: 7 Views: 1,213 So, assuming you aren't using arrays with thousands of elements, you can use this
do
swap = 0;
for (int i=0;i<n-1;i++) // n- nr of elements
if (anArray[i]>anArray[i+1])
{
... |
Forum: C Jun 15th, 2007 |
| Replies: 4 Views: 2,260 #include <stdio.h>
int main()
{
char drinkchoice; //gives drinkchoice a named character to be recognized
float insert= 0.00; //This allows the insert function to be used throughout... |