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

Write Code in C++ please!

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.

#include #include

using namespace std;

int main() {

int numOfStrings; //number of strings to be read in by program /* Declare any variables you need. */ cin >> numOfStrings; //reads in the number /* Type your code here. */

return 0; }

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!