Results 1 to 3 of 3

Thread: C code for area of circle

  1. #1
    WilsonMartin is offline Senior Member
    Join Date
    Dec 2009
    Posts
    319
    Rep Power
    3

    Default C code for area of circle

    Hi. I am new in c programming language. I want to right C code for area of circle. Please give me the proper codes it is highly appreciated.

  2. #2
    AndersonDiaz is offline Senior Member
    Join Date
    Dec 2009
    Posts
    311
    Rep Power
    3

    Default

    Try this, it will helpful for you.

    Code:
    #include <stdio.h> 
    #define PI 3.14159
    
    int main()
    {
    float area , radius ;
    printf("Enter the radius of the circle.n");
    scanf("%f",&radius);
    area = PI * radius * radius;
    printf("The area of a circle is %f.n",area);
    return 0;
    }

  3. #3
    TaylorRyan is offline Senior Member
    Join Date
    Dec 2009
    Posts
    307
    Rep Power
    3

    Default

    Try out this code, when you run this program you get the area of circle as an output result:

    Code:
    #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); 
    }

Similar Threads

  1. C code Area of circle:
    By GonzalezBrown in forum Programming
    Replies: 1
    Last Post: 05-19-2010, 01:33 PM
  2. C code for area of triangle
    By CoxWatson in forum Programming
    Replies: 2
    Last Post: 05-17-2010, 02:24 PM
  3. Circle simple c24
    By Zanetta Xever in forum other peripherals
    Replies: 0
    Last Post: 11-17-2009, 08:32 AM
  4. Circle Bloom cabinet
    By Victoro Xalvador in forum CPU & Components
    Replies: 0
    Last Post: 11-17-2009, 08:28 AM
  5. Alienware Area-51 and Area-51 ALX Core i7 Gaming PCs
    By Macavi6987 in forum Homebuilt Systems
    Replies: 0
    Last Post: 09-25-2009, 11:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48