Answer:
int withinArray(int * intArray, int size, int * ptr) {
if(ptr == NULL) // if ptr == NULL return 0
return 0;
// if end of intArr is reached
if(size == 0)
return 0; // element not found
else
{
if(*(intArray+size-1) == *(ptr)) // check if (size-1)th element is equal to ptr
return 1; // return 1
return withinArray(intArray, size-1,ptr); // recursively call the function with size-1 elements
}
}
Explanation:
Above is the completion of the program.
Answer:
// A optimized school method based C++ program to check
// if a number is composite.
#include <bits/stdc++.h>
using namespace std;
bool isComposite(int n)
{
// Corner cases
if (n <= 1) return false;
if (n <= 3) return false;
// This is checked so that we can skip
// middle five numbers in below loop
if (n%2 == 0 || n%3 == 0) return true;
for (int i=5; i*i<=n; i=i+6)
if (n%i == 0 || n%(i+2) == 0)
return true;
return false;
}
// Driver Program to test above function
int main()
{
isComposite(11)? cout << " true\n": cout << " false\n";
isComposite(15)? cout << " true\n": cout << " false\n";
return 0;
}
Explanation:
Answer:
See explanation
Explanation:
The attachment show that you've attempted the question already.
I'll assist in making corrections to your source code.
First, edit line 5 to
if(r<= 255 and g<=255 and b <=255):
Then edit line 8 to:
if(r>= 255):
Then edit line 11 to:
if(g>= 255):
Lastly, edit line 14 to:
if(b>= 255):
<em>Other part of the attachment is correct</em>
Answer:
public class Main {
public static void main(String[] args)
{
int n,m;
int k=5;
for(n=1;n<=k;n++)
{
for(m=1;m<=n;m++)
System.out.print(m);
System.out.print(" ");
}
}
}
Explanation:
The solution to this problem is the use of nested loops of an inner and outer loop to generate a half pyramid of numbers, but displayed on the same line so we have a sequence 1 12 123 1234 12345. The outer loop iterates for n=1 to n<=5 and the inner loop that has the print statement prints the integers from for m = 1 to m<=n.
Note that the value k = 5 is hard coded which in some sense is the number of rows, that is the length of iteration of the outer loop.
Apply encryption to VM files the following steps should be taken to secure the VMs so no user can copy or delete another user's VM files
f. Apply encryption to VM files.
b. secure the VM files with permissions
<u>Explanation:</u>
Installing anti-malware is a must on each VM OS OR Host OS to protect both servers and hosted workstations.
Scheduling update OS patches and anti-malware and scanning server or host operation are also must.
Securing VM files as best practices better to encrypt and decrypt is the best method or best practices.
Even protected VM files sometimes can be hacked and damaged the VM files.
VM is a virtual machine technology is used in windows 10. Before login decrypts the VM and connects to virtual machines. On disconnected encrypted is safer.