i need to display my out put in rows and colums like the this
Height--> 67 68 69 70 71 72 73
Weight:
120
130
140
150 THE ACTUAL BodyMassIndex DATA SHOULD APPEAR
160
170 IN HERE NICELY FORMATTED
180
190
200
210
220
230
can some one help this is what i have so far my data is correct just need help with out put display
Code:#include <iomanip> using namespace std; int main () { int weight_in_pounds = 120; int i,x; float weight_in_kilograms, height_in_meters, BodyMassIndex; cout <<" Height--> 67 68 69 70 71 72 73\n"; cout << "weight\n"; for(x=12; x>=1; x--) { int height_in_inches = 67; for(i=0; i<=6; i++) { weight_in_kilograms = weight_in_pounds / 2.2; height_in_meters = height_in_inches / 39.37; BodyMassIndex = weight_in_kilograms / (height_in_meters * height_in_meters); //cout <<" \n "; cout << setprecision(2) << fixed << weight_in_pounds <<" "<< BodyMassIndex; height_in_inches ++; } cout <<" \n "; weight_in_pounds = weight_in_pounds + 10; } system("pause"); return 0; }



LinkBack URL
About LinkBacks


