In main take two numbers as input num1 and num2. Main thread will create 2 more threads.
1. T1: Output sum of numbers from min(num1 , num2) to max(num1 , num2)
2. T2: Take a string as input and count num1 and num2 in it.
Write a C++ function, smallestIndex, that takes as parameters an int array and its size and returns the index of the first occurrence of the smallest element in the array. To test your function, write a mainthat prompts a user for a list of 15 integers and outputs the index and value of the first occurrence of the smallest value.
An example of the program is shown below:
Enter 15 integers:
1
2
3
4
5
6
7
8
9
0
10
11
12
13
14
1 2 3 4 5 6 7 8 9 0 10 11 12 13 14
The position of the first occurrence of the smallest element in list is: 9
The smallest element in list is: 0You can use the following integer lists to test your code:
main take two numbers as input num1 and num2. Main thread will create 2 more threads.
1. T1: Output sum of numbers from min(num1 , num2) to max(num1 , num2)
2. T2: Take a string as input and count num1 and num2 in it.
For this assignment Write a program in ‘C++’, that uses a Nested Structure to accept the name
of five Players of Chess:
Numbers of games played
Date of Birth
Date of playing first international game
Age
Status either win or loss
Use structures for Date of Birth and International Game in the main structure Chess.
struct chess
{
-------
-------
struct dob
{
------
------
};
struct igame
{
------
------
};
};
When the program runs, it should ask the user to enter data for five Players of Chess.
Paula and Danny want to plant evergreen trees along the back side of their yard. They do not want to have an excessive number of trees.
Write a program that prompts the user to input the following:
The program outputs:
Format your output with setprecision(2) to ensure the proper number of decimals for testing!
write c++ programm to swap first and last element of an integer 1-D array
Write a program that uses for loops to perform the following steps:
Write a program that uses do...while loops to perform the following steps:
The population of town A is less than the population of town B. However, the population of town A is growing faster than the population of town B.
Write a program that prompts the user to enter:
The program outputs:
(A sample input is: Population of town A = 5,000, growth rate of town A = 4%, population of town B = 8,000, and growth rate of town B = 2%.)
The population of town A is less than the population of town B. However, the population of town A is growing faster than the population of town B.
Write a program that prompts the user to enter:
The program outputs:
(A sample input is: Population of town A = 5,000, growth rate of town A = 4%, population of town B = 8,000, and growth rate of town B = 2%.)