Programe For Find The Area of Circle

Learn and Trouble Shoot Problems Related to C-Language here.

Programe For Find The Area of Circle

Unread postby rajeevmahura » Thu May 22, 2008 6:08 pm

/* Programe For Find The Area of Circle */
#include<conio.h>
#include<stdio.h>
#include<math.h>
void main()
{
float radius,area;
clrscr();
printf("Enter The Radius of Circle:- ");
scanf("%f",&radius);
area=3.14*pow(radius,2);
printf("Area of Circle is:- %f",area);
getch();
}
/*
Input:- Enter The Radius of Circle:- 7

Output:- Area of Circle is:- 153.860001
*/
--Regards--
Rajeev Mahura
Servers & Storage Professional
http://about.me/rajeevmahura
User avatar
rajeevmahura
 
Posts: 144
Joined: Tue May 20, 2008 5:22 pm
Location: Bangalore | New Delhi
Full Name: Rajeev Mahura
Date Of Birth: 15 Jan 1984
Address: New Delhi
Profession: DOEACC Trainer
DOEACC Center: DOEACC DELHI
Mobile No: 0

Re: Programe For Find The Area of Circle

Unread postby manojthesingham » Tue Sep 01, 2009 7:18 am

#include<stdio.h>
#include<conio.h>
/*
int printf("format args",..,..,..);
printf("B",printf("A"));
prints A then B
but comma has more precedence
int i = (1,2); 2 is stored
*/
const double PI=223.0/71.0;
int main(int argc,char **argv)
{
int r;
printf("Area of Circle is %f ",PI*r*r,scanf("%d",&r,printf("Enter the Radius of Circle : ")));
getch();
return 1;
}
If world is running, then I am idle..
If I am idle, then the world is running
User avatar
manojthesingham
 
Posts: 15
Joined: Tue Sep 01, 2009 5:39 am
Location: Coimbatore,Tamilnadu
Full Name: manoj
Date Of Birth: 31 Jul 1989
Address: Coimbatore18Tamilnadu
Mobile No: 0


Return to C-Language

Who is online

Users browsing this forum: No registered users and 2 guests

cron