Main Menu

HOME

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

US Job listings




   Misc

   Amazon

   Links

    


area of a circle
 

 

 

Description

This example works out the area of a circle depending on what the user enters for the radius

Code

#include <stdio.h>

#define PI 3.14159

int main()
{
float sum , radius ;
printf("This program works out the area of a circle.\n");
printf("Enter the radius of the circle.\n");
scanf("%f",&radius);
/*area of a circle is pi * radius * radius*/
sum = PI * radius * radius;
/*display the area*/
printf("The area of a circle is %f.\n",sum);
return 0;
}

Information

tested using Visual C++ 6 and Windows XP

 

 

 

 

 

Download

circlearea.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
VBScript supported(ASP.net)
Circumference of a circle(C)
multiple text example(Darkbasic)
Image resizer(PHP)
get the host name(ASP.net)
get the host address(ASP.net)
Status bar clock(Javascript)
A to Z links(PHP)

    




Copyright © 2003 by programmershelp.co.uk