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:
A program that can be used in many scenarios
Answer:
<u>PCIe</u> is used for video card installation on Laptop.
Explanation:
Good quality applications, videos and games required graphics card for better results. These card can be installed on laptops, that required some ports.
PCI-e is a slot, that is used in laptop for video or graphic card interface. Video card or graphic card is used to enable high quality video or graphics on Laptop.
PCI- E stand for Peripheral Component Interconnect Express. It work as serial communication interface for high speed device.
Someone downloads a pirated song or video a copyrighted image is used without permission and a person downloads and uses pirated software.
Answer:
All the mention codes are correct.
Explanation:
In the task1, a "name" variable is declared, that store a string, and in the next step, the built-in method "title, lower and upper" is defined, in which the title method capitalized the first character of the given word in each sentence, upper method change each character into upper case and the lower method changes each character into lower case.
In task2, a message variable is declared, that holds a string value in which the count method is used that counts the space character value.
In task3, a string value is used in the message variable, which uses a replace method to change the given string value.
In task3, a response variable is declared that uses an input method for input a string value, and inside the print method, len method is used that counts each input character number.