Purchase Solution

Most favorite loop structure

Not what you're looking for?

Ask Custom Question

What is the most favorite loop structure, and why?
How might you use it in a real business programming problem?

Give an example of how you might use a C array to solve a real life business problem.
Extra(notreally!): post a code sample too.

Purchase this Solution

Solution Summary

The solution determines the most favorite loop structure. An example using a C array is analyzed.

Solution Preview

In loop structure, FOR loop is the most favorite one.
Unlike many other kinds of loops, such as the while loop, the for loop is often distinguished by an explicit loop counter or loop variable. This allows the body of the for loop (the code that is being repeatedly executed) to know about the sequencing of each iteration. For loops are also typically used when the number of iterations is known before entering the loop.
Consider a business firm, a program is written to find out number of old timers in that firm. For that program, a first FOR loop is used to iterate each employee and a second FOR loop is used inside the first FOR loop for each department. so from this program the old timers can easily be sort out from every department, using nested FOR loops.

Following program is used to sort the products in a market. So sorting algorithm is used in this program, using arrays.

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

/* ...

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

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.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

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.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.