Answer:
create the integer variable and initialize it to one, with the do statement, increment the variable by one and print it, then the while statement checks if the variable is less than or equal to 10.
#include <iostream>
using namespace std;
int main(){
int i = 1;
do {
cout<< i << "\n";
i++;
}
while (i <= 10);
}
Explanation:
The C++ source code initializes the integer variable i to one and increments and print the value if the value is less than or equal to ten. The do-while statement executes a block of code before the condition is implemented.
Answer:
Since the question expect us to declare a C-string, the solution code is written in C as follows:
- char ssn[9];
- scanf("%s",ssn);
Explanation:
A C-String is a string written in C language. It is an array of characters. To declare a C-string, we use the keyword, <em>char </em>and then followed with the variable name + brackets and the number of characters in the string. For example, we can create a C-String for the SSN number as in Line 1.
To read standard input into the array, we can use C built-in function, <em>scanf(). </em>Just include a string placeholder, %s, and the variable<em> ssn </em>as arguments to <em>scanf()</em>. This will assign the string input by user to variable <em>ssn</em> as C-String.
Answer:
Explanation:
The arithmetic logic unit (ALU) performs mathematical, logical, and decision operations. It can be divided into the arithmetic unit (responsible for addition, subtraction, multiplication and division). And logic unit (responsible for comparing, selecting, matching and merging different data or information). The power and efficiency of the CPU depends on the design of the ALU.
Next up is the control unit (CU) which directs all the processor’s operations. It’s where the CPU reads and interprets requests from memory and transforms them into a series of signals (binary). Then it sends the operation to various parts of the laptop as instructed. The CU calls the ALU to perform the necessary calculations. It also coordinates all input/output devices to transfer or receive instructions.
The main job of the memory unit is to store data or instructions and intermediate results. It’s divided into primary memory and secondary memory to supply data to other units of the CPU. It allows the CPU to perform functions requested by programs like the operating system without having to ask RAM.
Another element of the CPU not depicted in the diagram is transistors. To carry out calculations, binary information (ones and zeros) is stored in these microscopic switches. They control the flow of electricity depending on whether the switch is ON or OFF. Signals turn off and on different combinations of transistors to perform calculations. A very thin silicon chip can contain several hundred million transistors.
It needs an Operating System like a cable or something that will help it operate look for more and double check