Write a program to find the youngest among the three persons by taking their ages as input?
1
Expert's answer
2011-07-15T14:27:42-0400
#include <iostream> using namespace std;
int main() { int youngest = 10000, youngest_index;
for (int i = 0; i < 3; ++i) { int age; cout << "Please enter age of person " << i+1 << endl; cin >> age; if (age < youngest) { youngest = age; youngest_index = i; } } cout << "The youngest is person " << youngest_index+1 << endl; return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment