How to WAP in C-language program to find out area of rectangle,square,triangle,circle.# java web services rest.

1:- WAP  in C-language  to find out area of rectanglejava 8 download.

Consider  a  c-program, which are use to find the area of Rectangle, and displays the result. the complete programs  are  shown as follows……
programming in c
c-laguage program
  #include<stdio.h>
    #include<conio.h>
     Void main()
 {
float  length, breadth, area;
Clrscr();
Printf(“Enter the value  of Length  \n”);
Scanf(“%f”,&length);
Printf(“Enter the value  of breadth  \n”);
Scanf(“%f”,&breadth); 
area=length*breadth;
printf(“area=%f”,area);
getch();
}
 Input:- Enter the value of Length and breadth
                Length =5
                Breadth =6

Output:- area=30 

2:- Write a program in C-language  to find out area of Square.

#include<stdio.h>
#include<conio.h>
Void main()
{
float  side, area;
Clrscr();
Printf(“Enter the value  of sides \n”);
Scanf(“%f”,&side);
area=(side*side);
printf(“area=%f”,area);
getch();
}
Input:-Enter the value of sides
s= 4
output:- area= 16
programming in c

3:- Write a program in C-language  to find  out area of Circle.

                   #include<stdio.h>
                     #include<conio.h>
                        Void main()
 {
float  redius, area;
Clrscr();
Printf(“Enter the value  of  radius \n”);
Scanf(“%f”,&redius);
area=(3.14*(redius*redius));
printf(“area of circle =%f”,area);
getch();
}
Input:- Enter the value  of  radius
            redius=4
output:-50.240002
programming in c

4:- Write a program in C –language  to find out area of  Triangle. 

  #include<stdio.h>



                     #include<conio.h>

                        Void main()

 {

float  height, breadth, area;

Clrscr();

Printf(“Enter the value  of height  and breadth\n”);
Scanf(“%f%f”,&l,&b);
area=((height*breadth)/2);
printf(“area of triangle=%f”,area);
getch();
}
Input:- Enter the value of height  and breadth
          height=3.5
          breadth=   6
      output:-  area =10.500000
programming in c
@Shiva

Post a Comment

0 Comments