View Single Post
Old 08-24-09 | 05:25 PM
  #27  
j3ffr3y's Avatar
j3ffr3y
chickenosaurus
 
Joined: Sep 2008
Posts: 1,189
Likes: 0
From: Boston, MA

Bikes: 2010 Motobecane Team Track, 1997 GT Edge, 2012 Kilo TT Stripper

Code:
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * main.c
 * Copyright (C) Jeff Crowell 2009 <crowell@bu.edu>
 * 
 * main.c is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * main.c is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <stdio.h>
int main (void)
{
	int width, weight;
	
	printf ("what is your tire width (in mm) ?\n");
	// receives the tire width
	scanf ( "%i", &width);
	
	printf ("What is your weight (fully clothed, carrying all of your stuff you normally do while on your bike, including the weight of the bike)\n");

	//receives the rider's weight
	scanf ( "%i", &weight );
	
	float area, pressure;
	area=width/25.4;
	pressure=weight/area*.63;
	printf ("you should be running about %f psi", pressure);
	return 0;
}
j3ffr3y is offline  
Reply