Search Result

Collapse
3 results in 0.0014 seconds.
Keywords
Members
Tags
multiplication
  •  

  • Starpedo
    started a topic Else/Else if statement for pay program
    in C

    Else/Else if statement for pay program

    How do I write a program which computes weekly pay for employees with the following characteristics ? The program should accept a pay ray and the number of hours worked. The output should be the amount of money the employee earned. Note that when an employee works more than 40 hours per week, they earn one and a half times their normal pay. If the user enters any inappropriate values, the program should output an appropriate error message. So far...
    See more | Go to post

  • Chris Winton
    started a topic How do i use the random number function?
    in C

    How do i use the random number function?

    Hello I'm using the random number function to try to multiply the values in the array O by a random number but receive the error - invalid operands to binary error*. Thanks for any help.

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    double O[1][6] = {{1, 1, 1, 1, 1, 1}};
    
    /*********** random number generator *******************/
    double srandom()   
    {
    return 2*((rand()/(double)RAND_MAX)
    ...
    See more | Go to post

  • kfindley
    started a topic Trying to do Simple Multiplication
    in C

    Trying to do Simple Multiplication

    I've been looking online but am having trouble finding sources on using C for basic multiplication. I'm assuming this is not the original purpose of C, but its what I need to do.

    If anyone can see glaring errors i'm making please let me know!

    I've tried declaring my variables as both doubles and int 's but to no avail.

    Code:
    #include <stdio.h>
     #include <math.h>
     int main()
    ...
    See more | Go to post
    Last edited by Banfa; Feb 22 '10, 10:26 PM. Reason: Added [code] ... [/code] tags
Working...