Answer:
#include <iostream>
using namespace std;
int main() {
int num, check=0;
for(int num = 1; num<=100;num++){
for(int i = 2; i <= num/2; i++) {
if(num % i == 0) {
check=1;
break; } }
if (check==0) { cout <<num<<" "; }
check = 0;
}
return 0;
}
Explanation:
This line declares num as integer which represents digits 1 to 100.
A check variable is declared as integer and initialized to 0
int num, m=0, check=0;
This for loop iterates from 1 to 100
for(int num = 1; num<=100;num++){
This iterates from 2 to half of current digit
for(int i = 2; i <= num/2; i++) {
This checks for possible divisors
if(num % i == 0) {
If found, the check variable is updated to 1
check=1;
And the loop is terminated
break; } }
The following if statement prints the prime numbers
if (check==0) { cout <<num<<" "; }
check = 0;
}
Which statement is true?
1)A deque is a type of collection,
2)A collection is a type of deque.
3)A list is a type of deque.
4)A deque is a type of list.
Answer:
1. A deque is a type of collection.
Explanation:
The statement that is true is as follows:
A deque is a type of collection.Thus, the correct option for this question is A.
What is Deque?Deque may be defined as an ordered and systematic collection of items similar to the queue. It is also known as a double-ended queue. It consists of two ends, a front, and a rear, and the items remain positioned in the collection.
According to the context of this question, a deque is a kind of collection that holds data and information identical to a queue. From here, elements can be added to or eliminated from either the front or back very efficiently.
It is also often called a head-tail linked list. Though properly this signifies specific data with appropriate structure that has been the implementation of a deque.
Therefore, a deque is a type of collection that is a true statement. Thus, the correct option for this question is A.
To learn more about Deque, refer to the link:
https://brainly.com/question/16750037
#SPJ2
What are url addresses for visiting websites? And what are the different parts of a URL? Answer it in a 1-2 paragraph
Answer:
Please read explanation
Explanation:
URL is the short form for "Uniform Resource Locator". A uniform resource locator tells the location of a website to the browser.
Parts of URL:
There are three main parts of URL
ProtocolDomain nameExtensionProtocol defines the type of protocol used for communicating with the website while the domain name is the name assigned to the IP address and the mapping is stored in domain name server and extension tells the type of website i.e.
.com means commercial
.org means non-profitable organization
.edu means educational website
An additional element is path which change with the website navigation.