Assignment
Assignment
:01*/
/*Program to calculate the summation of two number*/
/*Programmer Name: MD.TASNIMUL HASAN PLABON*/
/*Programmer ID:2207317*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
{
float a,b,result;
clrscr ();
printf("\n\n Enter the value of first number;");
scanf("%f",&a);
printf("\n\n Enter the value of second number;");
scanf("%f",&b);
result=a+b;
printf("\n\n The summation of the two numbers=%f",result);
printf("\n\n Press any key to exit......");
getch ();
}
Input: Enter the value of first number 3
Enter the value of second number 8
/*Programmer ID:2207317*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
clrscr ( );
float length,width,area;
scanf("%f",&length);
scanf("%f",&width);
area=length*width;
getch ();
Output:The area is 10
void main ()
{
float length,width,perimeter;
clrscr ();
printf("\n\n Enter the value of length;");
scanf("%f",&length);
printf("\n\n Enter the value of width;");
scanf("%f",&width);
perimeter=2*(length+width);
printf("\n\n The perimeter of the rectangle is=%f",perimeter);
printf("\n\n Press any key to exit......");
getch ();
}
void main()
{
clrscr();
float area,length,perimeter;
printf("\n\n Enter the value of area;");
scanf("%f",&area);
length=sqrt(area);
perimeter=4*length;
printf("\n\n the perimeter is=%f",perimeter);
printf("\n\n Press any key to exit.....");
getch();
}
Output:The perimeter is 20
Press any key to exit
/*Programming No.:05*/
/*Program to calculate the perimeter of a right angled triangle from given height & area*/
/*Programmer ID:2207317*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
float a,b,c,area,perimeter;
clrscr ();
scanf("%f",&area);
scanf("%f",&a);
b=2*area/a;
c=sqrt((a*a)+(b*b));
perimeter=a+b+c;
getch ();
void main ()
{
float a,b,c,area;
clrscr ();
printf("\n\n Enter the value of a;");
scanf("%f",&a);
printf("\n\n Enter the value of c;");
scanf("%f",&c);
b=sqrt((c*c)-(a*a));
area=(a*b)/2.0;
printf("\n\n The area is=%f",area);
printf("\n\n Press any key to exit....");
getch ();
}
Input:Enter the value of a 5
Enter the value of c 6
void main ()
{
float d,area;
clrscr ();
printf("\n\n Enter the value of d;");
scanf("%f",&d);
area=PI*d*d;
printf("\n\n The area of the circle is=%f",area);
printf("\n\n Press any key to exit......");
getch ();
}
void main ()
{
float r,area,circumference;
clrscr ();
printf("\n\n Enter the value of area;");
scanf("%f",&area);
r=sqrt(area/PI);
circumference=2*PI*r;
printf("\n\n The circumference is=%f",circumference);
printf("\n\n Press any key to exit.....");
getch ();
}
Input:Enter the value of area 25
void main ()
{
float d,circumference;
clrscr ();
printf("\n\n Enter the value of d;");
scanf("%f",&d);
circumference=PI*d;
printf("\n\n The circumference is=%f",circumference);
printf("\n\n Press any key to exit.......");
getch ();
}
Input:Enter the value of d 6
Output:The circumference 18.8496
Press any key to exit
/*Programming No.:10*/
/*Program to calculate the area of cylinder from given radious & height*/
/*Programmer Name: MD.TASNIMUL HASAN PLABON*/
/*Programmer ID:2207317*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define PI 3.1416
void main ()
{
float h,r,area;
clrscr ();
printf("\n\n Enter the value of r;");
scanf("%f",&r);
printf("\n\n Enter the value of h;");
scanf("%f",&h);
area=2*PI*r*(r+h);
printf("\n\n The area is=%f",area);
printf("\n\n Press any key to exit......");
getch ();