document1

15
1. Write the program to calculate the discharge capacity of pipe and channel. The width and the depth of channel and radius of the pipe is to be received from user and velocity of channel and pipe is to be assumed as 1.5 m/s and 3.5 m/s resp. PROGRAM: #include<iostream.h> #include<conio.h> #include<math.h> int main() { float wid,dep,r; float areap,areac,disp,disc; float vp=3.5,vc=1.5; cout<<"Enter the width of channel"; cin>>wid; cout<<"Enter the depth of channel"; cin>>dep; cout<<"Enter the radius of pipe"; cin>>r; areac=wid*dep; areap=3.14*pow(r,2); disc=areac*vc; disp=areap*vp; cout<<"The discharge capacity of channel="<<disc; cout<<"\nThe discharge capacity of pipe ="<<disp; getch(); } OUTPUT: Enter the width of channel 2 Enter the depth of channel2 Enter the radius of pipe1 The discharge capacity of channel=6

Upload: akshita-gupta

Post on 17-Sep-2015

212 views

Category:

Documents


0 download

DESCRIPTION

Answers

TRANSCRIPT

1. Write the program to calculate the discharge capacity of pipe and channel. The width and the depth of channel and radius of the pipe is to be received from user and velocity of channel and pipe is to be assumed as 1.5 m/s and 3.5 m/s resp.PROGRAM:

#include

#include

#include

int main()

{

float wid,dep,r;

float areap,areac,disp,disc;

float vp=3.5,vc=1.5;

coutwid;

coutdep;

coutr;

areac=wid*dep;

areap=3.14*pow(r,2);

disc=areac*vc;

disp=areap*vp;

cout