...
New to c programming...don't know where to start
Started by Witnesses, Jan 27 2008 02:46 AM
4 replies to this topic
#1
Posted 27 January 2008 - 02:46 AM
|
|
|
#2
Posted 27 January 2008 - 03:47 PM
First off, start by creating your main function, and declaring your variables, such as double radius, double height, etc. Then use scanf to input the values, and printf to print them out.
#3
Posted 27 January 2008 - 08:11 PM
...
#4
Posted 28 January 2008 - 09:08 AM
It looks like you're going in the right direction. Now, have you run it with test data to make sure you get the correct results? Compare the program's output to what you get by hand for the same data.
#5
Posted 29 January 2008 - 05:43 PM
Your surface area formula is only right if the cylinder has an open top. The second part should be 2*PI*rad*rad. Otherwise, it looks like your code is correct. You might want to check the input for negative values just for more error-catching. Otherwise, it's pretty good. Nice clean code.


Sign In
Create Account

Back to top









