Google analytics

Programs

Sum Of two numbers



/* To find the sum of two numbers. */

#include<stdio.h>
main()
{
     int i,j,a;
         scanf(“%d”,i);
         scanf(“%d”,j);
 
   
      a = i + j;
         printf(“sum of two numbers is= %d \n”,a);
}





Area of circle



/* To find the area of circle. */

#include<stdio.h>
#define PI 3.14159

int main()
{
  float sum , radius ;
    printf("This program works out the area of a circle.\n");
    printf("Enter the radius of the circle.\n");
   
     scanf("%f",&radius);

    sum = PI * radius * radius;

     printf("The area of a circle is %f.\n",sum);

  return 0;
}