<u>Answer:</u>
<em>int fNumber,scndNumber = -1, </em>
<em>dup = 0;
</em>
<em>do {
</em>
<em>cin >> fNumber;
</em>
<em>if ( scndNumber == -1) {
</em>
<em>scndNumber = fNumber;
</em>
<em>}
</em>
<em>else {
</em>
<em>if ( scndNumber == fNumber )
</em>
<em>duplicates++;
</em>
<em>else
</em>
<em>scndNumber = fNumber;
</em>
<em>}
</em>
<em>} while(fNumber > 0 ); </em>
<em>cout << dup;
</em>
<u>Explanation:</u>
Here three variables are declared to hold the first number which is used obtain all the inputs given by the user, second number to hold the value of <em>last encountered number and “dup” variable to count the number of duplicate values.</em>
<em>“Do-while”</em> loop help us to get the input check whether it is same as previous input if yes then it <em>adds to the duplicate</em> value otherwise the new previous value if stored.
<span>The schema will have to accommodate to make the person more easily able to perform the new task. Accommodation allows the new information to be made a part of a schema without changing the overall concepts in the schema. The schema itself stays unchanged for the most part, but the new information is more of a "tweak" to the schema than a full-on update.</span>
Answer:
d) either e1 or e5
Explanation:
Here, the instruction i1 goes ahead in trying to open the given file through an input stream buffer reader. If the given file name is wrong, it will indicate that an e1 file is not found or if any other IO errors due to invalid stream, no disc in drive e5 IO exception will be drawn.
Answer:
Explanation:
1. Write a program that declares an array named alpha with 50 components of the type double. Initialize the array so that the first 25 components are equal to the square of the counter (or index) variable and the last 25 components are equal to three times the index variable.
double alpha[50];
for (int i=0;i<25;i++)
{
alpha[i]=i*i;
alpha[i+25]=(i+25)*3;
}
2. Output the array so that exactly ten elements per line are printed.
for (int i=0;i<50;i++)
{
cout<<i+1<<". "<<alpha[i]<<" ";
if (((i+1)%10)==0)
{
cout<<endl;
}
}
3. Run your program again, but this time change the code so that the array is filled with random numbers between 1 and 100.
double alpha[50];
for (int i=0;i<50;i++)
{
alpha[i]=rand()%101;
}
for (int i=0;i<50;i++)
{
cout<<i+1<<". "<<alpha[i]<<" ";
if (((i+1)%10)==0)
{
cout<<endl;
}
}
4. Write the code that computes and prints the average of elements of the array.
double alpha[50],temp=0;
for (int i=0;i<50;i++)
{
alpha[i]=rand()%101;
temp+=alpha[i];
}
cout<<"Average :"<<(temp/50);
5. Write the code that that prints out how many of the elements are EXACTLY equal to 100.
double alpha[50],temp=0;
for (int i=0;i<50;i++)
{
alpha[i]=rand()%101;
if(alpha[i]==100)
{
temp++;
}
}
cout<<"Elements Exacctly 100 :"<<temp;
Please note: If you put each of above code to the place below comment it will run perfectly after compiling
#include <iostream>
using namespace std;
int main()
{
// If you put each of above code here it will run perfectly after compiling
return 0;
}
Answer:
The rules which could trigger at any period in time are referred to as the conflict set. A programming bug/conflict can occur when two programs compete for the same resource such as memory or register etc.
A Conflict Resolution Strategy is is a protocol which highlights which decision will be triggered first.
The best way to resolve conflict is to first determine the kind of conflict it is. Hardware conflicts can be resolved by first troubleshooting the hardware and in some instances unplugging the hardware causing the conflict.
When hardware creates conflicts it may be due to a driver issue. reverting to an old driver or updating the existing one may solve the problem.
Software conflicts can be resolved by installing updates or complete uninstallation.
Cheers!