alexiusacademia / cflow-01

A practice program in C to demonstrate basic concepts like variables, user input/output and loop.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cflow-01

Practice programming with C. This small program shows and practice the usage of C variables, user input and output using printf and scanf and the control structure while loop.

Program Information

This is a program for calculating water depth in a open channel flow for rectangular section channel. The inputs are:

discharge - The flow rate in m^3/s
n_manning - n. The Manning's roughness coefficient
channel_slope - The slope of the channel bed in m/m
base_width - The width of the channel in meters

The output is the computed water_depth or the depth of the water in the channel in meters.

Comparison between C and Python

To compare the 2 languages for performance, use the file flow_python.py for python, just run it using python 3 version. For the C counterpart, compile and run the code flow_c.c.

c-python

About

A practice program in C to demonstrate basic concepts like variables, user input/output and loop.


Languages

Language:C 89.9%Language:Python 10.1%