Answer:
In Python:
N = int(input("Positive integer: "))
if N > 0:
flag = False
for i in range(1,N+1):
if i * i == N:
flag = True
break
print(str(flag))
else:
print("Positive integer only")
Explanation:
N = int(input("Positive integer: "))
If the number is positive
if N > 0:
This initializes a boolean variable to false
flag = False
This iterates from 1 to the input integer
for i in range(1,N+1):
This checks if th number is a square of some integer
if i * i == N:
If yes, flag is set to true
flag = True
The loop is exited
break
This prints either true or false, depending on the result of the loop
print(str(flag))
If otherwise, that the number is not positive
<em>else:</em>
<em> print("Positive integer only")</em>
Answer: the corret answer C. The analyst has prefetch enabled on the browser in use.
Explanation:
The analyst has like an indicator which is prefetch enabled on the browser in use.
If a run-time error appears when you run a macro that has worked in the past, some part of the macro code no longer makes sense to excel, ehere run-time denotes <span> the time during which a program is running</span>
This error occurs while the program is running.
Running<span> out of memorywill results in a </span>run-time error.
<u>C++ program - Insertion sort</u>
<u></u>
#include <bits/stdc++.h>
using namespace std;
/* Defining function for sorting numbers*/
void insertionSort(int array[], int n)
{
int i, k, a;
for(i=1;i<n;i++)
{
k=array[i];
a=i-1;
while(a>=0 && array[a] > k) // moving elements of array[0 to i-1] are greater than k, to one position //
{
array[a+1] = array[a];
a =a-1;
}
array[a+1] =k;
}
}
/* Driver function */
int main()
{
int array[] = { 12,56,76,43,21};
//input integers
int n = sizeof(array) / sizeof(array[0]);
//finding size of array
insertionSort(array, n);
//Calling function
for (int i = 0; i < n; i++)
//printing sorted array
cout << array[i] << " ";
cout << endl;
return 0;
}
Answer:
When overloading, you define the <u>same</u> class function multiple times, each with different arguments. When overriding, you give a <u>new implementation</u> in a subclass for a virtual function defined in a base class.
Explanation:
The answer <em>is</em> the explanation.