Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main() {
// variable
int num;
int tot_sum=0;
cout<<"enter a number: ";
// read the value of n
cin>>num;
// check the multiple of 2 or 5 from 1 to n
for(int x=1;x<=num;x++)
{
// if multiple of 2 or 5 then add them
if(x%2==0 ||x%5==0)
{
tot_sum=tot_sum+x;
}
}
// print the sum
cout<<"sum of multiple of 2 or 5 is:"<<tot_sum<<endl;
return 0;
}
Explanation:
Read the number "n" from user.Check every number from 1 to n, if it is a multiple of 2 or 5 then add them to "tot_sum".When the for loop end, "tot_sum" will have sum of all the number which are either multiple of 2 or 5.Print the sum.
Output:
enter a number:11
sum of multiple of 2 or 5 is:35
The discipline of building hardware architectures, operating systems, and specialized algorithms for running a program on a cluster of processors is known as <u>parallel computing.</u>
<u></u>
<h3>What is Parallel Computing?</h3>
Parallel computing refers to the process of breaking down larger problems into smaller, independent, often similar parts that can be executed simultaneously by multiple processors communicating via shared memory, the results of which are combined upon completion as part of an overall algorithm. The primary goal of parallel computing is to increase available computation power for faster application processing and problem solving.
<h3>Types of parallel computing</h3>
There are generally four types of parallel computing, available from both proprietary and open source parallel computing vendors:
- Bit-level parallelism: increases processor word size, which reduces the quantity of instructions the processor must execute in order to perform an operation on variables greater than the length of the word.
- Instruction-level parallelism: the hardware approach works upon dynamic parallelism, in which the processor decides at run-time which instructions to execute in parallel; the software approach works upon static parallelism, in which the compiler decides which instructions to execute in parallel.
- Task parallelism: a form of parallelization of computer code across multiple processors that runs several different tasks at the same time on the same data.
- Superword-level parallelism: a vectorization technique that can exploit parallelism of inline code.
Learn more about parallel computing
brainly.com/question/13266117
#SPJ4
Answer:
Street prices are affected by the extent of illegal commercial copying. The availability of inexpensive, high-quality illegal copies reduces the demand for legal copies to the extent that some users buy illegal copies instead of legal ones.
Answer:
no
Explanation:
yellow: the last sentence in the text
blue: Queenies flowers reached for the sky
Personification means that you apply human characteristics to things that are not alive, like a flower smiling, a term used when people see a field of healthy flowers
Answer:
Explanation:
The following code is written in Java, the function takes in a list with the previous day's values. The function then uses that list, loops through it and multiplies each individual value by 2 and returns the modified list. The first red square represents the test case for the function, while the second red square in the image represents the output.
public static ArrayList<Integer> doubleIt(ArrayList<Integer> mylist) {
for (int x = 0; x<mylist.size(); x++) {
mylist.set(x, mylist.get(x)*2);
}
return mylist;
}