|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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.
|
|
|||||
|
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.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||
|
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.
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows XP Tricks & Tips!!!!..new ones. | pranky | Tutorials | 9 | 08-23-2008 04:22 PM |
| C++: How should you start learning it? | WingedPanther | C Tutorials | 8 | 03-25-2008 01:24 PM |
| Beginning Programming | frank_l | C and C++ | 11 | 10-11-2007 03:23 AM |
| New to programming... Python a good start? | TwoToedTurkey | Python | 3 | 08-01-2007 12:55 PM |
| How did you start programming? | TcM | General Programming | 22 | 01-19-2007 08:49 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%