-->

Modularizing and Reusing of code through Functions

Modularizing and Reusing of code through Functions

Modularizing and Reusing of code through Functions

Calculation of the area of a circle is separated into a separate module, from the calculation of an area of a ring, and the same module can be reused multiple times.

/* Program to find area of a ring */
#include<stdio.h>
int main()
{
float a1,a2,r1,r2;
printf(“enter the radius:”);
scanf(“%f”,&r1);
a1=3.14*r1*r1;
printf(“enter the radius:”);
scanf(“%f”,&r2);
a2=3.14*r2*r2;
a=a1-a2;
printf(“Area of ring: %3f\n”,a);
}

To understand, modularization and reusing of code through functions, let us consider the following program
Calculation of an area of a Circle from the calculation of an area of the ring and the same module can be reused a multiple times.
The calculation of an area of a ring, using repeated and reusable blocks of code is shown on the screen.
Here, blocks of code highlighted on the screen are used to find the areas of two circles from which the area of the ring is calculated as ‘a1-a2’ which is stored in ‘a’ and returned.

Modularizing and Reusing of code through Functions,call by value,call by reference,what is call by value,define call by value in functions,functions in c language,jntuh cse study material,jntu study material for first year,jntuh b.tech r18 cse study material, jntuh 3 2 cse study materials,jntuh 4-2 cse study materials,jntuh 2-2 cse study materials, jntuh 2-1 cse study materials,jntuh 3-1 cse study materials,jntuh 4-1 cse study materials, jntuh b.tech r16 syllabus,jntuh b.tech r18 syllabus,jntuh b.tech r16 3-2 syllabus,jntuh b.tech r16 2-2 syllabus, r16 jntu lecture notes,r18 jntu lecture notes, jntuh 2-1 lecture notes,jntuh 3-1 lecture notes,jntuh 4-1 lecture notes, jntuh 2-2 lecture notes,jntuh 3-2 lecture notes,jntuh 4-2 lecture notes, jntuh computer programming in c lecture notes, jntuh r16 computer programming in c notes pdf, jntuh r18 computer programming in c notes pdf,jntuh r18 syllabus pdf,estudies4you,c language lecture notes jntuh,r18 c language lecture notes,Void functions without parameters,Void functions with parameters,Non-void functions without parameters,No-void functions with parameters
Modularizing and Reusing of code through Functions
Modularizing and Reusing of code through Functions,call by value,call by reference,what is call by value,define call by value in functions,functions in c language,jntuh cse study material,jntu study material for first year,jntuh b.tech r18 cse study material, jntuh 3 2 cse study materials,jntuh 4-2 cse study materials,jntuh 2-2 cse study materials, jntuh 2-1 cse study materials,jntuh 3-1 cse study materials,jntuh 4-1 cse study materials, jntuh b.tech r16 syllabus,jntuh b.tech r18 syllabus,jntuh b.tech r16 3-2 syllabus,jntuh b.tech r16 2-2 syllabus, r16 jntu lecture notes,r18 jntu lecture notes, jntuh 2-1 lecture notes,jntuh 3-1 lecture notes,jntuh 4-1 lecture notes, jntuh 2-2 lecture notes,jntuh 3-2 lecture notes,jntuh 4-2 lecture notes, jntuh computer programming in c lecture notes, jntuh r16 computer programming in c notes pdf, jntuh r18 computer programming in c notes pdf,jntuh r18 syllabus pdf,estudies4you,c language lecture notes jntuh,r18 c language lecture notes,Void functions without parameters,Void functions with parameters,Non-void functions without parameters,No-void functions with parameters
Modularizing and Reusing of code through Functions

x

Related Posts

Subscribe Our Newsletter