Search
 
SCRIPT & CODE EXAMPLE
 

CPP

User defined functions and variables in C++ programming

#include <iostream>
#include <cmath>

using namespace std;

void compute_area () {
	float	pie = 3.14;
	float c;
	pow(c,2)/4 * pie;
	cout << "a";
}

int main() {
	
	double c, a;
	float r;
    float	pie = 3.14;
	
	cout << "Enter value for radius:
";
	cin >> r;
	
	c = 2*pie*r;
	cout << " The circumference of the circle is
: " << c;
	
	cout << "Enter value for c:
;";
	cin >> c;
	
	a = pow(c,2)/4 * pie;
	
	cout << "The area of the circle is
:" << a;


   compute_area();

Comment

PREVIOUS NEXT
Code Example
Cpp :: friend function in c++ 
Cpp :: disallowcopy c++ 
Cpp :: C++ program for Celsius to Fahrenheit and Fahrenheit to Celsius conversion using class 
Cpp :: create new node in tree 
Cpp :: onoverlapbegin ue4 c++ 
Cpp :: c++ open webpage 
Cpp :: how to check if vector is ordered c++ 
Cpp :: cmake g++ address sanitizer 
Cpp :: how to write int variable c++ 
Cpp :: set iterator 
Cpp :: linear search 
Cpp :: c++ while loop 
Cpp :: move elements from vector to unordered_set 
Cpp :: c++ list of pairs 
Cpp :: count number of char in a string c++ 
Cpp :: c++ convert to assembly language 
Cpp :: Split a number and store it in vector 
Cpp :: time complexity 
Cpp :: sum of n natural numbers 
Cpp :: copy vector c++ 
Cpp :: tr bash 
Cpp :: how to modify 2d array in function c++ 
Cpp :: binary multiplication 
Cpp :: visual studio code terminal keeps closing c++ 
Cpp :: C++ CHEAT SHEAT 
Cpp :: css window id 
Cpp :: how to find second smallest element in an array using single loop 
Cpp :: kadane algo 
Cpp :: identity 
Cpp :: Calculating Function codeforces in c++ 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =