Subscribe For Free Updates!

We'll not spam mate! We promise.

Sunday, 26 August 2012

C++ Code to Display weight and height of 5 persons



// Displaying weight and height of 5 persons
// hw6_q6.cpp
// Programmer name: Sohail Ahmed
// fine_sohail@yahoo.com
// Date: 24-03-2010

#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int i=1;
float weight_1,height_1,weight_2,height_2,weight_3,height_3,weight_4,height_4,weight_5,height_5;
cout<<"Enter weight of 1st person: ";
cin>>weight_1;
cout<<"\nEnter height of 1st person: ";
cin>>height_1;
cout<<"\nEnter weight of 2nd person: ";
cin>>weight_2;
cout<<"\nEnter height of 2nd person: ";
cin>>height_2;
cout<<"\nEnter weight of 3rd person: ";
cin>>weight_3;
cout<<"\nEnter height of 3rd person: ";
cin>>height_3;
cout<<"\nEnter weight of 4th person: ";
cin>>weight_4;
cout<<"\nEnter height of 4th person: ";
cin>>height_4;
cout<<"\nEnter weight of 5th person: ";
cin>>weight_5;
cout<<"\nEnter height of 5th person: ";
cin>>height_5;
cout<<endl<<endl;

cout<<"Serial No\tWeight\tHeight\n";
cout<<"1.\t\t"<<weight_1<< "\t"<<height_1<<endl;
cout<<"2.\t\t"<<weight_2<< "\t"<<height_2<<endl;
cout<<"3.\t\t"<<weight_3<< "\t"<<height_3<<endl;
cout<<"4.\t\t"<<weight_4<< "\t"<<height_4<<endl;
cout<<"5.\t\t"<<weight_5<< "\t"<<height_5<<endl;

getch();
return 0;
}

Socializer Widget By CodingLovers
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment