Write a program that finds the smallest word and largest

Assignment Help C/C++ Programming
Reference no: EM132081279

You need the programs to be in C code, if possible can you provide a screen shot of the solution running please.

Lab 9.1 Write a program that prompts for your first name and then last name. Enter them respectively and make your full name and output it.

Lab 9.2

Write a program that finds the smallest word and largest word in a series of words. The program must stop accepting input when the user enters "stop". Assume that no word is more than 20 letters long. The following is an example run:

Enter word: dog

Enter word: zebra

Enter word: rabbit

Enter word: cat

Enter word: fish

Enter word: stop

Smallest word: cat

Largest word: zebra

Lab 9.3. In Lab 4.2 you were asked to write a program that counts the number of vowels (a,e,i,o,u) in a sentence entered from the keyboard. Now define a function that contains a string parameter. The function will counts the number of vowels in the string parameter and returns the count. Call the function in the main.

4.2 Lab code:

char sentence;

int vowels = 0;

int i;

printf("Enter a Sentence: \n");

sentence = getchar();

while (sentence != '\n')

{

if (sentence == 'a' || sentence == 'e' || sentence == 'i' || sentence == 'o' || sentence == 'u' || sentence == 'A' || sentence == 'E' || sentence == 'I' || sentence == 'O' || sentence == 'U')

{

vowels++;

}

sentence = getchar();

}

printf("There are %d vowels in the given sentence \n", vowels);

Reference no: EM132081279

Questions Cloud

Determine necessary consideration for building your program : Displays a list of animal/habitat options (based on the previous selection) as read from either the animals or habitats file.
Share of common stock be selling for in the market : The company has a dividend payout ratio of 50%, book value per share of $33.5 and a P/E ratio of 15. What should one share of common stock
Identify at least one candidate key : Identify at least one candidate key. If there are no candidate keys, give an example of an attribute that could be used as a candidate key.
What is the value of company : If the cost of capital is 10%, what is the value of this company?
Write a program that finds the smallest word and largest : Write a program that prompts for your first name and then last name. Enter them respectively and make your full name and output it.
The art of cinematography : To create an effective designed, the director, cinematographer, and production designer need to work together
What is the company current stock price : The company's beta is 1.65, the market risk premium is 8.5%, and the risk-free rate is 5.50%. What is the company's current stock price?
What was his return on invested capital : How much money did Mark make? What was his return on invested capital, given that the initial margin was 12.50%?
What is the market value of the contract : Since he was young, Mark has been at his family's business house, which has to do with growing and selling Eastern Australia Canola

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Explain in a one to two 1-2 page narrative a use case

as an intern software developer for a retail bank you have been tasked with developing use cases to support the atm

  Components of the position and velocity vectors

This is embodied in the governing ODE above, and dictates the motion of the planets and other orbiting bodies. But what if the laws of physics were different? What if the force weren't inversely-proportional to the distance squared, but instead to..

  Prepare a program that reads in a list of integer

Prepare a program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered.

  Write a program that asks you to enter an consumption figure

Write a program that asks you to enter an automobile gasoline consumption figure in the European style (liters per 100 kilometers) and converts to U.S. style.

  One of the disadvantage of pass by reference

One of the disadvantage of pass by reference is that the called function may inadvertently corrupt the called data. How ca this be avoided?

  Program to generate 100,000 prime numbers

Write a POSIX C/C++ program to generate 100,000 prime numbers. Assume that the program will be run on a computer with 5 CPUs and that your goal is to have this program finish as quickly as possible.

  Write some code that puts a zero in every element of q

Given a two-dimensional array of integers named q, with 2 rows and 4 columns, write some code that puts a zero in every element of q. Declare any variables needed to help you.

  Sorting or searching the array elements

When will code of a C program about sorting a array, what operation does machine do first to sort the array first, sorting or searching the array elements?

  What is the importance of creating own data types

What is the importance of creating your own data types? What are the benefits and drawbacks from developing your own data types?

  Single command-line argument

How would you go about writing a C program that takes a single command-line argument, the name of a file.The program reads this file

  Finish or complete the coding for me because syntax and code

finish or complete the coding for me. because syntax  and codes, so the proram can execute correctly

  Application which will read a file of daily payments

C++ application which will read a file of daily payments, calculate the total as well as the average payment, display the results to the screen and write the results to a file. The input and output file names should be provided as command line argume..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd