# Thread: Help on Starting a Program!

1. ## Help on Starting a Program!

Hi, I have an exam in a few days and I have no idea where to start with writing this program, I have looked at my notes and I have no idea how to starts. Could someone give me a hand with how to start off, I would really appreciate it. I'm not asking for you to do my homework, I just need to know where to start so I can use it as practice to study for my exam. Many thanks!

Instructions:

1. Read your notes concerning loops with particular attention to while and for loops.
2. Write the pseudocode (algorithm) for the following program definition: The German mathematician Gottfried Liebniz developed the following method to approximate the value of pi:
pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...
Write a program that allows the user to specify the number of iterations used in this approximation and that displays the resulting value.

During the lab:

1. Using Quincy, write the C program based on your algorithm.
2. Eliminate the syntax errors.
3. Run your program and test it.
4. Debug your program if necessary until you get correct results.

2. Err... start by "read(ing) your notes concerning loops with particular attention to while and for loops"?

3. Review the formula someplace, like Wikipedia:
Leibniz formula for

Then study how you would do it, and use a correct implementation to compare with:
mattst88's leibniz pi code

REALLY get to know it like the back of your hand - maybe better!

4. Originally Posted by Sharpenel
Hi, I have an exam in a few days and I have no idea where to start with writing this program, I have looked at my notes and I have no idea how to starts. Could someone give me a hand with how to start off, I would really appreciate it. I'm not asking for you to do my homework, I just need to know where to start so I can use it as practice to study for my exam. Many thanks!

Instructions:

1. Read your notes concerning loops with particular attention to while and for loops.
2. Write the pseudocode (algorithm) for the following program definition: The German mathematician Gottfried Liebniz developed the following method to approximate the value of pi:
pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...
Write a program that allows the user to specify the number of iterations used in this approximation and that displays the resulting value.

During the lab:

1. Using Quincy, write the C program based on your algorithm.
2. Eliminate the syntax errors.
3. Run your program and test it.
4. Debug your program if necessary until you get correct results.
Start like this:

Code:
```#include <stdio.h>

int main(void)
{
/* Logic goes in here */
return 0;
}```