Thread: i did not understood to the question. But i did i don't know is this correct or not

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2021
    Posts
    4

    Post i did not understood to the question. But i did i don't know is this correct or not

    Code:
    #include <stdio.h>
    #include <math.h>
    int
    factorial (int number)
    {
      int factorial;
      factorial = 1;
    
    
      for (int i = number; i > 1; i--)
        {
          factorial *= i;
        }
      return factorial;
    }
    
    
    
    
    int sigma()
    {
        int sigma = 0;
        int n=2;
        for(int i=0; i<=100; i++){
            sigma += n*i+1;
        }
        return sigma;
    }
    
    
    
    
    float sinus_cal(float x)
    {
        float sinus;
        float u = 0;
        int l = sigma();
        for(int i=0; i<=100; i++){
            // -1^i
            u += pow(-1, i);
        }
        sinus = ((u / factorial(l)) * pow(x,l));
        return sinus;
    }
    
    
    int main()
    {   
        printf("%f",sinus_cal(3));
        return 0;
    }
    Attached Images Attached Images i did not understood to the question. But i did i don't know is this correct or not-midterm4-png 
    Last edited by Jaloliddin; 04-26-2021 at 05:33 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. have i finally understood this or is it another fluke
    By cooper1200 in forum C Programming
    Replies: 3
    Last Post: 05-26-2019, 04:10 PM
  2. I thought I understood this.
    By somekid413 in forum C Programming
    Replies: 2
    Last Post: 01-11-2010, 08:32 PM
  3. Have I understood the atoi funtion right?
    By austra in forum C Programming
    Replies: 5
    Last Post: 11-13-2009, 09:15 AM
  4. Functions are Still Not Understood.
    By errigour in forum C Programming
    Replies: 6
    Last Post: 04-09-2009, 02:54 PM
  5. I thought I understood but....(pointer question)
    By caroundw5h in forum C Programming
    Replies: 1
    Last Post: 02-22-2005, 03:05 AM

Tags for this Thread