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
Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
int[] arr = {4, 6, 9, 12};
int sum = 0;
for(int i=0; i<arr.length; i++){
sum += arr[i];
}
for(int i=0; i<arr.length; i++){
System.out.print(arr[i] + " ");
}
System.out.println("");
System.out.println("The sum of the numbers: " + sum);
}
}
Explanation:
* The code is written in Java.
- Initialize the array with the given numbers
- Initialize the <em>sum</em> variable as zero
- Calculate the sum in the first for loop
- Print the numbers in the second for loop
- Print the <em>sum</em>
Answer:
C) the online catalog.
Explanation:
An online library catalog describes the periodicals, videotapes, and books as it is the electronic bibliographic database. This evolved from the printed source, the library card catalog. Hence, this clarifies that its C. the correct option.
However, LexisNexis is the unit that gives computer-assisted research CALR and business research as well as risk management services. So through this, you can get the legal and journalistic documents.
And the stack or the book stack which is referred to as the library building block is for book storage. And the library of Congress Subject Headings is active since 1898 and holds the catalog materials which are being collected by the Library of Congress, and they do not keep track of periodicals. And the BizMiner is for financial reports.
Hence, the correct answer is the C) the online catalog.