1. ## iam a noob and i need help please

Dear gurus
iam crying for help with my program. i can not get anything to appear on the screen. can someone explain to me what i did wrong.
Please someone help me out iam a nob, so i only know basic coding.
here is my program.

This program should have 3 functions
A) explain() explain the program to the user
C)calc_display() calculate the surface and prints the surface area and volume using the volumes #define statement and display this values to 3 decimal places

Formula
surface of area of spehere = 4*3.14*raidus^2

/*
Title: Sphere
Name: TONY
Date: feb 21 2008
Description: calculate the surface area and volume of a sphere.
The user will input a radius and the program will
do both calculations
*/

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

#define 4*3.14*pow(radius,2) // formula surface area of a sphere

// Function Prototype
void explain (void);
void calc_display (float area, float volume);

// Function Call
main()
{
system("cls");
explain();
calc_display(e,t);
system("cls");
getch();
return 0;
}

//Function definition
void explain (void)
{ puts("");
puts("");
}

scanf("&#37;f",&a);
return(a);
}

void calc_display (float area, float volume)
{
printf("The area is %.3f and the volume %.3f", area, volume);
}

3. Some things I can spot right away are:
* main should return int.
* It's better to use getchar() instead of getch()
And maybe you should also explain a little better what "no output" means. Do you get the typical dos window? And is it just blank?

4. Basic thoughts: you should really only use #define to define constants. You can use #define to make macros, but it's not something for the faint of heart. None of those things you are #defining are constants. --- Looking at your posted assignment, that makes no sense. Either you or your instructor have lost your mind.

You should maybe take the time to calculate area and volume before printing them out.

I don't know what you think you're doing with get_radius.

Suddenly in the calc_display function, the variable names make sense. You should try to imitate that throughout the program.

You should post code using the code tags. (Look for the # sign in the editor.)

Even if something prints, you'll never see it since you immediately clear the screen. Don't do that.

5. Instead of using #define statements, and since you seem to understand how to write a function, why not write a function like get_radius, that will be called get_volume and pass in radius as a parameter, and return the formula calculated over that parameter?

Your entire program looks like you ain't got a clue what you are writing. I don't understand how it even compiles?
Code:
`#define 4*3.14*pow(radius,2) // formula surface area of a sphere`
Think what you are #defining here if you know that the syntax of #define is:
#define IDENTIFIER TEXT...

you do not know if the pow function if optimized to process the square in a special way

7. Code:
```/*
Title: Spherical Crap
Name: BELIAL
the surface area and volume of a sphere...amen.
*/

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// XXX I removed <conio.h>, getch() does not work on my Linux machine :-(

// XXX I got rid of the diameter #define and "fixed" the below #define's

// Function Prototype
void explain (void);
void calc_display (float radius); // XXX fixed the parameters of this function :-D

main()
{
system("cls");
explain();
e=get_radius(t);  // XXX 't' and 'e' are the same variables...interesting!
calc_display(e);
system("cls");
return 0; // XXX you returned 0!  good job!  (not many ppl remember this)
}

//Function definition
void explain (void)
{ puts("");
puts("");
}

scanf("%f",&a);
return(a);
}

void calc_display (float radius)  // XXX FIxed the parameters ;)
{
float volume = RADIUS_TO_VOLUME;  // XXX added this to calculate the volume and area
float area = RADIUS_TO_AREA;      // from the #define's.
printf("The area is %.3f and the volume %.3f", area, volume);
}```

8. main should be
Code:
`int main(void)`
get_radius does not need a parameter
Code:
```float get_radius (void)
{
fflush(stdout); /* in case the stdout stream is buffered */