Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   Misc

   Amazon

   Links

    


calculates the circumference and area of a circle
 

 

Description

This example calculates the circumference and area of a circle when the radius is given.

Code

/*work out circumference and area of a circle*/
#include <stdio.h>
#define PI 3.14159

int main(void)
{
float area , circumference , radius;
printf("What is the radius of the circle.\n");
scanf("%f",&radius);

area = PI * radius * radius;
circumference = 2.0 * PI * radius;

printf("The circumference of the circle is %1.2f.\n",circumference);
printf("The area of the circle is %1.2f.\n",area);

return 0;
}

Information

tested using Visual C++ 6

 

 

 

 

Download

circlecalc.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
Split a string(PHP)
insert contents of text file into a text box(VB)
File Details(ASP)
Constants in C(C)
Image resizer(PHP)
display the cookies present(VBScript)
Folder size(ASP)
accept users input using input dialog box(Java)

    




Copyright © 2003 by programmershelp.co.uk