1 Write a c Program Using Video Studios 2015 that finds the

1. Write a c Program Using Video Studios 2015 that finds the \"smallest\" and \"largest\" in a series of words. After the user enters 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.

2.Write a c Program Using Visual Studios 2015 that Defines the structure “HoursMinutesSeconds” with three simple variables int Hours, int Minutes and float Seconds to declare times in Hours, Minutes and Seconds. Then write a program to add two HoursMinutesSeconds times and store the result in the third HoursMinutesSeconds time. Remember to make necessary seconds to Minutes and Minutes to hour conversions. Note: 60 Seconds = 1 minute and 60 Minutes = 1 hour.

OUTPUT

1 hours 25 minutes 30 seconds   

+ 2 hours 35 minutes 20 seconds

-----------------------------------------

4 hours 0 minutes 50 seconds

3. write a C program Using Visual Studios 2015 that asks the user to enter an international dialing code and then looks it up in the Country_codes array, If it finds the code, the program should display the name of the corresponding country; if not the program should print an error message.


355 --- Albania
213 --- Algeria
684 --- American Samoa
376 --- Andorra
244 --- Angola
809 --- Anguilla
268 --- Antigua
54 --- Argentina
374 --- Armenia
297 --- Aruba
247 --- Ascension Island
61 --- Australia
672 --- Australian External Territories
43 --- Austria
994 --- Azerbaijan
242 --- Bahamas
246 --- Barbados
973 --- Bahrain
880 --- Bangladesh
375 --- Belarus
32 --- Belgium
501 --- Belize
229 --- Benin
809 --- Bermuda
975 --- Bhutan
284 --- British Virgin Islands
591 --- Bolivia
387 --- Bosnia and Hercegovina
267 --- Botswana
55 --- Brazil

Solution

#include <algorithm> // for std::swap, use <utility> instead if C++11
#include <iostream>

int main()
{
const int length = 5;
int array[length] = { 30, 50, 20, 10, 40 };

// Step through each element of the array
for (int startIndex = 0; startIndex < length; ++startIndex)
{
// smallestIndex is the index of the smallest element we\'ve encountered so far.
int smallestIndex = startIndex;

// Look for smallest element remaining in the array (starting at startIndex+1)
for (int currentIndex = startIndex + 1; currentIndex < length; ++currentIndex)
{
// If the current element is smaller than our previously found smallest
if (array[currentIndex] < array[smallestIndex])
// This is the new smallest number for this iteration
smallestIndex = currentIndex;
}

// Swap our start element with our smallest element
std::swap(array[startIndex], array[smallestIndex]);
}

// Now print our sorted array as proof it works
for (int index = 0; index < length; ++index)
std::cout << array[index] << \' \';

return 0;
}

3)

1. Write a c Program Using Video Studios 2015 that finds the \
1. Write a c Program Using Video Studios 2015 that finds the \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site