values of sine

This is a discussion on values of sine within the C Programming forums, part of the General Programming Boards category; Hi guys. I need to calculate the values of sine function between 45 and 90 degrees (5 degrees step). So ...

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    32

    values of sine

    Hi guys. I need to calculate the values of sine function between 45 and 90 degrees (5 degrees step).

    So far I have the following code:
    Code:
    #include <stdio.h>
    #include <math.h>
    
    void fprint();
        
    float degree[10]={45,50,55,60,65,70,75,80,85,90};
        int main ()
        {
        fprint();
        return 0;
        }
        void fprint();
        {
        int i=0;
        int deg=45;
        }
        while (i<90)
        {
        degree[i]=sin(deg);
        deg=deg+5;
    }
    Could you help me a little bit and tell me what should be the next step?

  2. #2
    cas
    cas is offline
    Registered User
    Join Date
    Sep 2007
    Posts
    975
    I suggest going back to your earlier C lessons that are less complicated. I don't mean to be rude, but you should not be trying to do things like this when you don't understand functions, loops, or arrays.

    Eventually when you're ready to try this, remember that sin() takes a value in radians, not degrees.

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    32
    Could you point me out some good tutorial on arrays?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. putting values into an array
    By zdream8 in forum C Programming
    Replies: 15
    Last Post: 05-21-2008, 11:18 PM
  2. Replies: 1
    Last Post: 12-30-2007, 09:08 AM
  3. Need help with project
    By chrisa777 in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2006, 05:01 PM
  4. Sending values to a control
    By Zyk0tiK in forum C Programming
    Replies: 6
    Last Post: 12-02-2005, 05:29 PM
  5. Replies: 1
    Last Post: 02-03-2005, 02:33 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21