Purchase Solution

Writing a Program that Finds the "Smallest" and "Largest" Words

Not what you're looking for?

Ask Custom Question

Write a program that finds the "Smallest" and "Largest" in a series of words. After the user enter the words, the program will determine which words would come first and last if the words were listed in dictionary order. The program must stop accepting input when the user enters a four-letter word.assume that no word is more than 20 letters long. An interactive session with the program might look like.

Enter word: dog
Enter word: zebra
Enter word: rabbit
Enter word: catfish
Enter word: walrus
Enter word: cat
Enter word: fish

Smallest word: cat
Largest word: zebra

This is from the C programming/a modern approach by K.N.King.

Must be in code-blocks (C not C++).

Purchase this Solution

Solution Summary

The solution (n code-blocks C not C++) writes a program that finds the "smallest" and "largest" in a series of words. It determines which ones come first and last if the words were listed in dictionary order.

Solution Preview

Please see the attachment.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void main() {
char inputStr[30];
char ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C# variables and classes

This quiz contains questions about C# classes and variables.