please answer this question of computer working should be in IDLE answer all of them if you know the answer then only answer else reported
Answers
Answer:
1.
#include<stdio.h>
int main() {
int rad;
float PI = 3.14, area, ci;
printf("\nEnter radius of circle: ");
scanf("%d", &rad);
area = PI * rad * rad;
printf("\nArea of circle : %f ", area);
ci = 2 * PI * rad;
printf("\nCircumference : %f ", ci);
return (0);
}
2.
#include <stdio.h>
int main()
{
float length, width, area;
/*
* Input length and width of rectangle
*/
printf("Enter length of rectangle: ");
scanf("%f", &length);
printf("Enter width of rectangle: ");
scanf("%d", &width);
/* Calculate area of rectangle */
area = length * width;
/* Print area of rectangle */
printf("Area of rectangle = %f sq. units ", area);
return 0;
}
2.
#include <stdio.h>
int main()
{
float length, width, area;
/*
* Input length and width of rectangle
*/
printf("Enter length of rectangle: ");
scanf("%f", &length);
printf("Enter width of rectangle: ");
scanf("%d", &width);
/* Calculate area of rectangle */
area = length * width;
/* Print area of rectangle */
printf("Area of rectangle = %f sq. units ", area);
return 0;
}