FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpp-programming/OOP1-Lab5/Source.cpp at main · AvraamG/cpp-programming · GitHub
AvraamG
/
cpp-programming
Public
forked from
Rustam-Z/cpp-programming
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-programming
/
OOP1-Lab5
/
Source.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (24 loc) · 852 Bytes
Breadcrumbs
cpp-programming
/
OOP1-Lab5
/
Source.cpp
Copy path
File metadata and controls
29 lines (24 loc) · 852 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
Practical Lab Assignment-7(Week 9)
//
ID:U1910049 Name: Rustam Zokirov
//
Program to calculate area of a circle using functions
#
include
<
iostream
>
#
include
<
math.h
>
//
C++ libriry which is including "pow" and PI=3.14
using
namespace
std
;
float
area
(
float
radius)
{
//
function for calculating the area
float
area;
area = (
atan
(
1
) *
4
) * (
pow
(radius,
2
));
//
"atan" is the function which is finding the PI=3.14
return
area;
}
//
end function "area"
int
main1
()
{
float
radius;
cout <<
"
Please enter the radius of circle:
"
;
cin >> radius;
//
inputing the radius
if
(radius >
0
)
cout <<
area
(radius) << endl;
//
calling the function "area" for calculating the Area of Circle
else
cout <<
"
INVALID Radius!
"
<< endl;
//
if radius is a negative number or equal to zero the program will show "Invalid radius"
system
(
"
pause
"
);
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL