Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)
C Program To Find Area Of Semi Circle | C Programs
Latest :

C Program To Find Area Of Semi Circle | C Programs

C Program to find the Area of a Semicircle – In this particular article, we will detail in on the ways to find the area of a semicircle in C programming. The ways in which the area of a semicircle is calculated in this piece are as follows:

  • Using Standard Method
  • Using Function
  • Using Pointers
  • Using Macros

As we all know, a semicircle is exactly half that of a circle. A semicircle is cut right through the diameter of a circle. The diameter divides a circle into two semicircles.

The area of a circle can be calculated by multiplying half of its perimeter or circumference with that of its radius.

The area of a circle is

=> A = (1/2) πr^2 * r

=> A = πr^2.

Since a semicircle is equal to half of a circle, the area of a semicircle is also half of that of the area of a circle. Thus, the area of a semicircle is as follows:

A = (1/2) * πr^2

=> A = (1/2)πr^2.

Henceforth, this formula will be used in the upcoming Java programs to find the area of a semicircle. A semicircle is demonstrated in the image here:

Semicircle

Using Standard Method

  • For calculating the area of the semicircle, we need the radius of a circle.
  • The value of radius will store into the variable “r”.
  • By substituting the “r” value into the formula then we will get the area of the semicircle, that will be assigned to the variable “area”
Output:

Using Function

  • We are using the function float area(float r) to calculate the area of the semicircle, the return type of this function is a float.
  • Using area(r)we are calling the function which is having float type argument.
  • The called function area(float r) calculates the area of a semicircle and returns the value, the return value will be assigned to the variable “a”.
Output:

Using Pointers

  • We are calling the function by passing addresses as arguments using area(&r, &a)
  • Then called function area(float *r, float *a) which is having pointers as arguments will calculate the area of the semicircle, and that value will store into the variable “a”
Output:
Using Macros
  • area(r) is a symbolic name to the expression (22*r*r)/(2*7).
  • area(r) replaced with that expression given at #define.
Output:
x

Check Also

C Program To Count The Total Number Of Notes In A Amount | C Programs

C program to count the total number of notes in a given amount – In ...

bakırköy escortşişli escortsightcareDeneme Bonusu Veren SitelerDeneme Bonusu Veren SitelerDeneme Bonusu Veren SitelerDeneme Bonusu Veren Sitelerdeneme bonusu veren sitelergrandpashabetgrandpashabetGrandpashabetdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelercasinofastbetwoondeneme bonusu veren sitelerdeneme bonusugrandpashabetdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelergrandpashabetgrandpashabetbetgray güncel girişdeneme bonusu veren sitelerDeneme Bonusu Veren Sitelerbetgray günceljojobetcasibom güncelcasibom güncel girişhalkalı escortsakarya escortmatbetholiganbetdeneme bonususonbahisteosbetpusulabetjojobetbetnanobets10Jojobetjokerbettimebetnakitbahistrendbetjojobet girişjojobet girişultrabetartemisbettürk ifşaJojobetcasibom girişcasibomjojobetsolibetsolibet girişsolibet giriş adresisolibetsolibetcasibomcasibom girişgalabet girişbetpuanodeonbetodeonbetcasibomcasibomtürk ifşa girişholiganbetonwinpusulabetcasibom girişbetofficecasibombetnano girişmeritbetkatlaholiganbetJojobetpadişahbetvaycasino girişcasibom güncelcasibom güncel girişcasibom girişsohbet hattıbetasusgrandpashabetgrandpashabetkatlameritbetmeritbetmeritbettürk ifşa girişcasibommarsbahismarsbahisbetzulaalobet girişbetzula girişalobetalobet girişalobetmarsbahismeritkingcasibomcasibom girişJojobet girişasyabahisgrandpashabetholiganbet girişmarsbahismarsbahis güncel girişjojobetjojobet girişcasibomcasibom girişpadişahbet girişmarsbahistürk ifşa girişmarsbahismarsbahis girişgrandpashabetvaycasinocasibomcasibom girişgrandpashabetgrandpashabetgrandpashabetgrandpashabetcratosroyalbetbetwoonjojobetGrandpashabetyakabetbetkolikbetnanojojobet girişpadişahbetpadişahbetkalebetaresbetdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerdeneme bonusu veren sitelerromabetjojobetholiganbetvaycasinovaycasino girişKocaeli EscortelexbetelexbetbetciograndpashabetramadabetramadabetramadabetspincoLidyabetholiganbetholiganbetmarsbahismarsbahis girişpadişahbetparmabetbetkolikbetpuanbetpuanparmabetmarsbahis,marsbahis güncel girişholiganbetgrandpashabetpusulabetcasibommatbet girişjokerbetbahislioncasibom girişcasibomkavbetholiganbetholiganbetpusulabetmatbetcasibomgobahismatbetcasibomcasibom girişjojobetsekabetjojobet güncel girişRomabetmatbetBetnanoKulisbetKulisbetKulisbetholiganbetbetebet girişbetebetmatadorbet girişgrandpashabetmarsbahisonwin girişPusulabet yeni Girişsahabet girişmatbet girişsahabetimajbet girişonwinvdcasinoholiganbet girişholiganbetmatbetpusulabet girişgrandpashabetpusulabetBetsmovematbetjojobet girişmatbetbetboxmarsbahis girişmarsbahismatbet güncel girişpusulabet girişgrandpashabet girişholiganbet girişmarsbahis girişvdcasinovaycasinocasibom