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 :: c++ permutation 
Cpp :: add for input output file in c/c++ 
Cpp :: convert from hex to decimal c++ 
Cpp :: how to initialize priority queue c++ 
Cpp :: Fibonacci Series Program. in c++ 
Cpp :: equal elements in two arrays in c++ 
Cpp :: uses of c++ 
Cpp :: how to put string in array c++ 
Cpp :: c++ environment setup 
Cpp :: sinonimo de tratar 
Cpp :: qt graphics scene map cursor position 
C :: c bold text 
C :: calculate distance between 2 points X Y axis 
C :: install gitk mac 
C :: haskell print 
C :: C hello workld 
C :: c print size_t 
C :: font awsome circle info icon 
C :: Succ de ch 
C :: Call by reference to pass an array to the function in C- 
C :: c bit access union 
C :: function for quicksort in c 
C :: C read a character 
C :: go optional parameters 
C :: c int 
C :: c substring 
C :: remove string from string c 
C :: c round float 
C :: unable to locate package dos2unix 
C :: print to console in c 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =