Answer:
Explanation:
The following code is written in Java and is a function/method that takes in an int array as a parameter. The type of array can be changed. The function then creates a counter and loops through each element in the array comparing each one, whenever one element is found to be a duplicate it increases the counter by 1 and moves on to the next element in the array. Finally, it prints out the number of duplicates.
public static int countDuplicate (int[] arr) {
int count = 0;
for(int i = 0; i < arr.length; i++) {
for(int j = i + 1; j < arr.length; j++) {
if(arr[i] == arr[j])
count++;
}
}
return count;
}
A raptor program that will display the count from 100 to 0 in decrements of 5 is shown below.
<h3>What is a raptor program?</h3>
This refers to a programming environment that works on a flowchart basis to help the user to present their algorithms in a visual manner.
Using a raptor program, you can display a count from 100 to 0 in decrements of 5 as shown:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int count;
Count =100;
while (Count<=0)
{
cout << Count << endl;
Count =Count-5;
}
return 0;
}
The result would be a list showing numbers that go from 100 to 0 in decrements of 5.
Find out more on raptor programs at brainly.com/question/15082977
#SPJ1
Answer:
num1 = int(input("Enter number 1: "))
num2 = int(input("Enter number 2: "))
choice = input("Do you want to multiply them?: ")
if choice.capitalize() == "Yes":
print(num1 * num2)
else:
print("Peace out.")
Explanation:
Gg ez.
(I wrote the it in python because I don't know what language you want it in. Next time, say what language you want.)
Answer:
When you shut down your PC, all your open programs close and the PC shuts down your operating system. but In sleep mode, the PC enters a low-power state. The PC's state is kept in memory, but other parts of the PC are shut down and won't use any power.
Explanation:
The computer brain is a microprocessor called the central processing unit (CPU). The CPU is a chip containing millions of tiny transistors.