nevermind fixed everything myself, thanks all
Type: Posts; User: evangela
nevermind fixed everything myself, thanks all
Ok, the whole program seemingly executes now, however sometimes it freezes after the first function and doesn't go anywhere, and also there is something wrong with my bubble sorting function. It...
Very wise words indeed. I don't know how to make it stricter because im using bloodshed DEV C++ compiler, but seeing that you said I didn't do everything quzah suggested, I added an & before the...
so I fixed the bogus number problem by removing the & before the n in the print statement.
But it still has an extra place for the user to input something after getting "n" before the loop starts...
caught that error before you responded, still does the exact same thing. Gives a bogus number and takes 3 inputs and then closes.
I need to write a program that accepts an integer n, where n is the number of elements going into the array. Have the user input n, integers. Have a function that ouputs the current array. And...
ugh...looks like I'm going to need to hire a c-sci tutor...no idea what's going on and the teacher epic fails.
I don't exactly know what exactly is to be calculated though. Am I supposed to write an equation for this?
[(-1)^n](n+1)(x^2n)/n!
so like...
to do [(-1)^n]
you would write
Yeah that's the basic loop that will repeat n times, but the whole summation is what I don't get.
The terms inside of the loop need to work, but I don't even know what I'm supposed to be writing...
I know how to do each individual part of the equation, but when I try to piece each part together it comes out wrong...
Thanks for the help King Mir, but we have not learned how to use the for() command yet. So I'm not sure if that will work! I still have not found a solution...ugh
#include <stdlib.h>
#include <stdio.h>
int main()
{
float stepA, stepB, stepC, stepD, stepE, onePow, twoPow, factorial, n, x, i;
scanf("%f", &n);
scanf("%f", &x);
twoPow = x * x;...
n= 3 10 15 200
x= 2 2 2 2
Ans = -25.666668 0.865679 -0.057734 ...
#include <stdlib.h>
#include <stdio.h>
float myFunc(float inputN);
int main()
{
float n, x, result;
And I don't see how the given numbers....
1 – 2(x^2)/1! + 3(x^4)/2! – 4(x^6)/3! + … + [(-1)^n](n+1)(x^2n)/n!
I don't see how the first digits are to be calculated through iteration... It has...
In the assignment it says the last term is [(-1)^n)]. But the first line of the term that solves 1^n in the first iteration will be 1 to the power of 1...which will never be higher than 1, is there...
#include <stdlib.h>
#include <stdio.h>
float myFunc(float inputN, inputX);
int main()
{
float n, x, result;
Nope, it's supposed to be a fairly simple program, without the need for recursive methods. I know the basics of how to do the actual math equations, I just don't know how to do power of N.
So a function is just like a mini program from within a program? So you can make any function that does anything you want?
ex.
myFunction()
it says I need to compute -1^n, and later on x^2n. ...
I understand that the factorial function looks like...
int nFact(int m)
{
int i;
int nfact;
i = nfact = 1;
while ( i<=m )
So the sequence looks somewhat like -4, +5, -6, +7, -8? Subtracting for odd numbers and adding for even numbers? That does help but unfortunately I'm not really sure how to make the program know...
He didn't really specify what data type it is, besides it's c programming. I haven't had any real issues until this assignment. Where I have no idea where to even start. If I can just understand...
Doesn't a function have to be a certain thing? Like pow(base, power)? I can't see how you could compute all those different equations from within one function, since can't a pow() function only...
I have an assignment that states that you have to write a function that calculates...
1 – 2(x^2)/1! + 3(x^4)/2! – 4(x^6)/3! + … + [(-1)^n](n+1)(x^2n)/n!
The general term is:
negative one to...
everything works, deleted all quotes of code and stuff, so my classmates don't steal it. Thanks for all the help Quzah and tab stop.
Just quick question, is there a certain "format" for pseudo...