Question: In C ++ please Write a program that uses a FOR loop to read in a set number of strings as input, and outputs the

In C ++ please

In C ++ please Write a program that uses a FOR loop

to read in a set number of strings as input, and outputs

Write a program that uses a FOR loop to read in a set number of strings as input, and outputs the string with the least characters. The first input will be the number of strings that will be input. You may assume that each string has at least one char in it and does not contain any spaces. Each input string will end with an endl. If the input is 4 "hello" "ILoveCake" "pie" "cookies", all without the quotes, the output is "pie", without quotes, since it has the least number of characters. End your output with a new line. You can assume at least one string is input. Hint: If two strings have the same minimum size, use the string that was input first. 1 #include 2 #include 3 4 using namespace std; 5 6 int main() { int numofStrings; /umber of strings to be read in by program /* Declare any variables you need. */ cin >> numofStrings; //reads in the number 7 8 9 10 11 12 13 14 15 16 17 18 } 19 /* Type your code here. */ return

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!