C programming ke jariye Circle aur
rectangle ka area kaise find kiya jata hai , iske liye hum program write karane
wale hai.
Formula:
Area of circle = pir2
Area of rectangle = length * breath
/* Program for area of circle */
#include<conio.h>
#include<stdio.h>
#define pi 3.14
void main ()
{
int r;
float area;
clrscr();
printf("\n Enter radius of circle
");
scanf("%d", &r);
area = pi * r *r ;
printf ("\n Area of circle
=%f", area);
getch();
}
Output:
Enter radius of circle
5
Area of circle= 78.5
Program Rectangle ka area find
karane ke liye:
/* Program for area of rectangle
*/
#include<conio.h>
#include<stdio.h>
void main ()
{
int l,b,area;
clrscr();
printf("\n Enter Length &
Breadth of rectangle ");
scanf("%d%d", &l,&b
");
area = l*b;
printf("\n Area of
rectangle=%d", area);
getch();
}
Output:
Enter Length & Breadth of
rectangle
15
25
Area of rectangle= 375
Aapka koi suggestion, query ho to
comment ke through aap hume bata sakate hai.
Latest updates ke liye humara facebook page like kare.
Other Programs:
0 Comments: