2
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by Prelektro
Featured Replies
  • 1
    WaltP 2,905   5 Years Ago

    No, I'm talking about the [B]Do provide evidence of having done some work yourself if posting questions from schoolwork assignments[/B] section. You must be under the mistaken impression we are a homework service. We are not. [I]You[/I] do the work, [I]we[/I] help solve problems - in a [I]teaching[/I] manner, not … Read More

0

i'm kinda beginner.

It shows. Beginners rarely bother to read the Member Rules nor the sticky post Read This Before Posting before asking a question.

Edited by WaltP: n/a

0

Well actually i have read it.if you are talking about "don't give away code" section,okay. Thing is, i need it for tomorrow evening, it's homework and i know so little about C right now. I have final exam 2 weeks later, just bought some books and stuff and will work for it but now i don't have time to learn things and do it. sorry if it's against posting rules.

1

No, I'm talking about the Do provide evidence of having done some work yourself if posting questions from schoolwork assignments section.

You must be under the mistaken impression we are a homework service. We are not. You do the work, we help solve problems - in a teaching manner, not a rewrite it for me manner.

>>Thing is, i need it for tomorrow evening
As the saying goes, "Poor Planning On Your Part Does Not Constitute An Emergency On Our Part".

0

Sorry about that than but why so serious ? :D Anyway, i managed to solve my first question but now i have another one. Listened your advice and I did some work. The problem is I don't know how to terminate series like it is asked in problem. Can you help me out now ?

[IMG]http://img193.imageshack.us/img193/2381/adszxmz.jpg[/IMG]

Uploaded with ImageShack.us

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

static double factoriel(int a){
    double result = 1.0;
    while (a > 0) {
        result*=a;
        a--;
    }
    return result;
}


int main(void){ 

double total=0.0;
double temp=0.0;
float x;
printf("Please give me the x value: ");
scanf("%f",&x);
x = x *3.14/180;

    for(int i=0;true;i++){
            total+=  pow((-1),i) * pow(x,((i*2)+1)) / factoriel((i*2)+1);
              
            
            
                           
            
            if(pow((-1),i) * pow(x,((i*2)+1)) / factoriel((i*2)+1)/total<0.001){
                                 printf("%d",i);
            break;
            }
                          
                          

         }
         printf("\nSin%f: %f \n",x,total);
    system("pause");
    return 0;
}

Edited by Prelektro: n/a

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.