1. Write a Program to Take input from user Print Area Of Circle c program.
2. write a Program To take input from user print Area of Triangle c Program .
3. Write a Program to Take input from user Print Area of Rectangle c Program.
1.
Write a Program to Take input from user Print Area Of Circle c program - Program Code.
/* Write a Program to take input
from user print area of circle */
#include<stdio.h>
#include<conio.h>
#define PI 3.14
int main()
{
float area,radius;
clrscr();
printf("Enter the value of radius :");
scanf("%f",&radius);
area = PI * radius *radius;
printf("Area of circle is %f",area);
getch();
return 0;
}
OUTPUT :-
2.
Download Program source codeDownload Program source code
2.
write a Program To take input from user print Area of Triangle c Program - Program Code.
/* Write a Program to take input
from user print area of triangle */
#include<stdio.h>
#include<conio.h>
int main()
{
float area,h,b;
clrscr();
printf("Enter the value of h :");
scanf("%f",&h);
printf("Enter the value of b :");
scanf("%f",&b);
area = (h*b)/2;
printf("Area of Triangle is %f",area);
getch();
return 0;
}
3.
Write a Program to Take input from user Print Area of Rectangle c Program - Program Code.
/* Write a Program to take input
from user print area of rectangle */
#include<stdio.h>
#include<conio.h>
int main()
{
int area,l,w;
clrscr();
printf("Enter the value of l :");
scanf("%d",&l);
printf("Enter the value of w :");
scanf("%d",&w);
area = l*w;
printf("Area of rectangle is %d",area);
getch();
return 0;
}
PROGRAM :-
0 Comments
If You have any query, Please let me know..