UPDATED:

How To Make A Simple Calculator By C Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... Happy Coding.......... This blog is under construction!!!!
Namecheap.com

Thursday, June 2, 2016

How to find circle area using πr ² formula in C

πr² is a common formula to us.But can you find a circle area value by C?
if not,try this.It's help you to know how to find/print the value of a circle 
area in C programming language.


Code to print the value:


#include<stdio.h>

#define PI 3.1416

int main()
{
    float circle_area, r;

    printf("Enter the value of radius: \n");
    scanf("%f", &r);

    circle_area = PI *r * r;

    printf("The circle area is: %.2f\n", circle_area);


return 0;

}


OR,


#include<stdio.h>



int main()

{
    float circle_area, r, PI=3.1416;

    printf("Enter the value of radius: \n");

    scanf("%f", &r);

    circle_area = PI * r * r;


    printf("The circle area is: %.2f\n", circle_area);



return 0;


}


The Output is:




Face problems?No problem.You can share your problems by commenting below.or you can leave a massage us.Thank you.

No comments:

Post a Comment

Namecheap.com

Popular Posts