Suppose that you are working with XYZ company and received a new task by your supervisor.
Your task is to write a C++ program to identify person who have height more than 180cm and
weight less than 50kg based on 5 different persons inputs. Prepare an algorithm for this problem
and write a complete C++ program. You must state a meaningful comment for each of your line.
#include <iostream>
int main()
{
float weight = 0;
int height = 0;
for(int i = 0; i != 5; ++i)
{
std::cout<<"__XYZ__"<<std::endl;
std::cout<<"Please enter your weight: ";
std::cin>>weight;
std::cout<<"Please enter your height: ";
std::cin>>height;
if(weight < 50 && height < 180)
{
std::cout<<"You are detected"<<std::endl;
}
}
return 0;
}
Comments
Leave a comment