Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C language program that inputs ASCII characters and stores them in a character array until the enter key is hit (0x0D) or until

Write a C language program that inputs ASCII characters and stores them in a character array until the enter key is hit (0x0D) or until 32 characters have been entered. Next, end the character array with the null character (0x00). Display this character (string) array on a new line in the hyperterminal window. Finally, have the program sort these ASCII characters from lowest to highest and display on a new line this sorted character array. The program should then print a new line and start over waiting for user input.

For example, if the input is:

45F37X

The output display for this program would be:

45F37X

3457FX

A simple sorting algorithm can be used to sort the ASCII character array:

for(i = 0; i++; i < N-1){

for(j = 0; j++; j < N-1){

if( ARRAY[j] > ARRAY[j+1] ){

temp =ARRAY[j];

ARRAY[j]=ARRAY[j+1]

ARRAY[j+1]=ARRAY[j]

}

}

}

where N is the number of elements in the array ARRAY[i] that are to be sorted.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

Students also viewed these Databases questions

Question

6. Explain how to use five training techniques.

Answered: 1 week ago

Question

1. What goals will be sought?

Answered: 1 week ago

Question

Differential cost is the same as

Answered: 1 week ago

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago