AD4BP

Write a programe for find diagonal of rectangle by length & width.

#include< stdio.h >
#include< conio.h >
#include< math.h >
void main( )
{
int a,b;
float c;
clrscr( );
printf("Enter length of rectangle:");
scanf("%d",&a);
printf("Enter width of rectangle:");
scanf("%d",&b);
c=sqrt(a*a+b*b);
printf("Daigonal of ractangle=%f",c);
getch( );
}

Output:-
Enter length of rectangle:4
Enter width of rectangle:3
Daigonal of ractangle=5.000000