Write a C program to accept radius of a circle and display the area and circumference of a circle.
#include<stdio.h>
#include<conio.h>
void main()
{
int radius;
float area, circumference;
// Accept radius of circle
printf("Enter the radius of cicle: ");
scanf("%d",&radius);
//calculate area and circumference of circle
area=3.14*radius*radius;
circumference=2*3.14*radius;
//displaying area and circumference of circle
printf("\nArea of circle is: %f",area);
printf("\nCircumference of cirle is: %f",circumference);
}
-
Next Write a program to calculate sum of following series up to n terms. Sum=X+X2 /2!+X3 /3!+…… (Note: Write separate user defined function to calculate power and factorial)
-
Previous Create a structure employee (id, name, salary). Accept details of n employees and write a menu driven program to perform the following operations. a) Search employee by id b) Display all employees
0 Comments