answersLogoWhite

0

/*to find the area of a circle*/

#include<stdio.h> #include<conio.h> main()

{

int r;

float a;

print f ("Enter r value \n");

scan f ("%d", &r);

a=3.14*r*r;

print f("area=%f",a);

}

User Avatar

Wiki User

16y ago

Still curious? Ask our experts.

Chat with our AI personalities

DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
More answers

#include<assert.h>

typedef struct rect_t {

int width;

int height;

} rect;

int area (rect* r) {

if (r==NULL) return 0;

return r->width * r->height;

}

int main (void) {

rect r;

int a;

r.width = 10;

r.height = 5;

a = area (&r);

assert (a==50);

return 0;

}

User Avatar

Wiki User

9y ago
User Avatar

double areaofcircle (double radius) return 2. * 3.141592653589793 * radius;

User Avatar

Wiki User

13y ago
User Avatar

double a,b,c,s,area;

double *parea = &area;

s=(a+b+c)/2;

*parea = sqrt (s*(s-a)*(s-b)*(s-c))

User Avatar

Wiki User

15y ago
User Avatar

Add your answer:

Earn +20 pts
Q: C program to calculate area of circle?
Write your answer...
Submit
Still have questions?
magnify glass
imp