techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduedusedusedusedueduedusedusedus C Program Area Of Rectangle | C Programs
Latest :

C Program Area Of Rectangle | C Programs

C Program to find the area of a rectangle – In this particular article, we will discuss how to calculate the area of a rectangle in C Programming. The methods used in this specific article are as follows:

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

As we all know, rectangles are extremely commonly used quadrilaterals. In a rectangle, the opposite sides are equal and parallel. Essentially, every square is a rectangle since its opposite sides are equal and parallel as well.

The area of a rectangle can be calculated as:

Area = Length * Breadth

A rectangle looks like this:

Rectangle

As you can see, the area of this very rectangle can be calculated very easily. The area of this rectangle is:

Area = 9 * 4 = 36 sq. units.

Thus, the different methods with which the area of a rectangle can be calculated in C programming are as follows:

Using Standard Method

1)We declared the variables length,breadth,area.

2)By substituting the values into the formula area=(length*breadth), we will get the value of area which is assigned to the variable “area”.

output:

Using Function

1)We are using the function area(float l, float b) to calculate the area of a rectangle.

2)Using the code area(l,b) we are calling the function. here area(l,b) is calling function.

3)The called function area(float l, float b) will calculate the area and return the value, that return value will be assigned to the variable “a”.

output:

Using Pointers

1)We are passing the references as arguments using the calling function area(&l,&b,&a).

2)The called function area(float *l, float *b, float *area) will calculate the area of a rectangle, which is having pointer variables as arguments.

3)The calculated value will store into the pointer variable “area”.

output:
Using Macros

1)area(l,b) is symbolic name to the expression (l*b).

2)In the code area(l,b) replaced with that expression given at #define.

output:
x

Check Also

C Program To Input Any Alphabet And Check Whether It Is Vowel Or Consonant

C program to input any alphabet and check whether it is vowel or consonant – ...

atakoy escortatakoy escortbakırköy escorthalkali escortbağcılar escortsightcarekayseri escortmaltepe escortdeneme bonusu veren sitelerbasaksehir escortistanbul, escortromabetdeneme bonusu veren sitelerdeneme bonusu veren siteleratlasbetjojobetbelek escortjojobet토토사이트Deneme Bonusu Veren Sitelergrandpashabetdeneme bonusu veren sitelergrandpashabetgrandpashabetgrandpashabetistanbul escortcasino siteleriDeneme Bonusu Veren SitelerAlanya EscortDeneme Bonusu Veren Sitelercasibom girişholiganbet girişCasibom girişGrandpashabetbetmarinopaşacasinojojobetpadişahbetsekabet girişcasibomjustin tvcasibom güncel girişcasibomtaraftariumselçuksportsultraslotcasibomultraslotultraslotvbetgrandpashabetcasibom girişcasibom güncel girişdeneme bonusu veren sitelergrandpashabetdeneme bonusu veren sitelerdeneme bonusu veren siteleronwinonwinmatbetHoliganbetHoliganbetmeritbetbetpassekabetcasibomcasibom güncel girişmeritbetbahsegelmatadorbetbetplay girişvaycasinocasibomhiltonbet girişcasibomİmajbetbetparkgrandpashabetjojobetbetcio güncel girişcasibom girişcasibomcasibom girişbetcio güncel girişgrandpashabetbetturkey güncel girişcasibomcasibom girişcasibomcasibom girişgrandpashabetmarsbahismarsbahis girişjojobetGrandpashabetcasibomimajbetOtobetNakitbahisbetturkeybetturkeyzbahisbetcioOtobetcasibomHoliganbetgrandpashabet girişvaycasinobahiscombahiscomperabetvaycasinomarsbahis güncel girişgrandpashabetOtobetgrandpashabetGrandpashabetjojobet girişsekabetsekabet girişgrandpashabetcasibomcasibom güncel girişsekabet girişbahsegel girişmatadorbet girişbetpark girişerome pornparibahisbetciocasibomBetsatjojobetcasibomholiganbetcasibomcasibomcasibom girişcasibom güncel giriş