Monday, April 22, 2019

IO 11

  • Problem Description

    Write a program to calculate area of a circle

    Input and Output Format:

    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output.
  • Test Case 1

    Input (stdin)
    2

    Expected Output
    Area of Circle=12.560000

    Area of Circle=12.56
  • Test Case 2

    Input (stdin)
    25

    Expected Output
    Area of Circle=1962.500000

    Area of Circle=1962.50
Solution

#include <stdio.h>
int main()
{
float a,area;
  scanf ("%f",&a);
  area=3.14*a*a;
  printf ("Area of Circle=%0.6f",area);
  printf ("\nArea of Circle=%0.2f",area);  
return 0;
}

No comments:

Post a Comment

Parity

Problem Description Ram and Sita playing the parity game. Two types of parity are there. One is odd parity and next is even parity. Ram will...