How this blog work !
" I create this web blog for helping all computer science students and who interested in computer science. That means this blog work as a helper in your educational carrier. If you have any doubts in your subject (computer science) and you want to know more about in your syllabus topics or Seminar topics pleas E-mail your doubts and your name ,college name, Email ID to edugang@gmail.com . Then you will get the answer with in week (I ensure 99% chance to get your answer) in your email address.If you forgot to send your name ,college name ,Email ID then I can’t publish your answer.If you want the answer of any question immediately (with in a day)you can contact me in my number shown in the about "

Wednesday, October 13, 2010

program to find area & circumference of a circle

Buzz It
Question :Write a program to find area and circumference of a circle
Question From :
 Fathima Neethu
Malappuram 
fathimaneethu88@gmail.com 
Answer:

import java.io.*;
import java.lang.*;
import java.io.DataInputStream;
class Area
{
    int r;
void calculate()
{

    try
    {
        DataInputStream in=new DataInputStream(System.in);
        r=Integer.parseInt(in.readLine());
}
catch(Exception e)
{
}
    System.out.println("Area of the circle = " + 3.14*r*r);
    System.out.println("Circumference of the circle = " + 2*3.14*r);
}   
}
class AreaDemo
{
    public static void main(String args[])
    {
        Area area=new Area();
        area.calculate();
        }
    }


O/P

0 comments:

Post a Comment

 

CSedukit.com | Headlines

Sponsors

Advertise Now!