Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ area & circumference of a circle

	int rad;
    float area, circum;

	cout << "Input the radius(1/2 of diameter) of a circle: ";
    cin >> rad;

	area = 3.14 * rad * rad; // 3.14 * (rad * rad);
    circum = 2 * 3.14 * rad;
Comment

C++ Area and Circumference of a Circle

    float rad,circum,area;
    const float PI = 3.14159265;

    cout<<"Input the radius of the Circle: ";
    cin>>rad;

    circum = 2*PI*rad;
    area = PI*rad*rad;

    cout<<"The Diameter is "<<area<<" and the circumference is "<<circum;
Comment

PREVIOUS NEXT
Code Example
Cpp :: stack in c++ 
Cpp :: how a function gives a pointer as parameter c++ 
Cpp :: return function in cpp 
Cpp :: C++ Area and Circumference of a Circle 
Cpp :: Default code in C++ for VSCode 
Cpp :: c++ for loops 
Cpp :: c++ destructor 
Cpp :: check if a word is in map c++ 
Cpp :: open a url with dev c 
Cpp :: c++ function with parameters 
Cpp :: #include using namespace std; int main() { double leashamt,collaramt,foodamt,totamt; cout<<"Enter the amount spent for a leash : "; 
Cpp :: qt graphics scene map cursor position 
C :: malloc is undefined 
C :: rename c 
C :: convert from integer to string vb 
C :: space after format specifiers in c 
C :: bubble sort a linked list in c 
C :: c data types 
C :: C program to count number of digits in a number 
C :: operators priority in c 
C :: 0/1 knapsack problem in c 
C :: reverse list in C 
C :: round function in c 
C :: how to sort assending in c 
C :: Hello world in C programming language 
C :: add a item to cart woocomerce with quantity 
C :: array size in c 
C :: create role in psql with password 
C :: c loop 
C :: c exit 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =