Answer:
#include <stdio.h>
void spaces(int n) {
for(int i=0; i<n; i++) {
putchar(' ');
}
}
void numbersdown(int n) {
for(int i=n; i>1; i--) {
putchar('0'+i);
}
}
void numbersup(int n) {
for(int i=1; i<=n; i++) {
putchar('0'+i);
}
putchar('\n');
}
int main(void) {
int number;
printf("Please enter a digit: ");
scanf("%d", &number);
for(int i=number; i>0; i--)
{
spaces(number-i);
numbersdown(i);
numbersup(i);
}
}
Explanation:
I deliberately separated the solution into different functions for readability. If needed, the code could be made much more compact.
Answer:
int number = (int)(Math. random() * 10); By multiplying the value by 10, the range of possible values becomes 0.0 <= number < 10.0
please mark me as the brainliest answer and please follow me for more answers.
Answer:
#include <iostream>
const double PI = 3.14159;
int main() {
double diameter;
std::cout << "Please enter the diameter of the circle:" << std::endl;
std::cin >> diameter;
double radius = diameter / 2;
double area = radius * radius * PI;
double circumference = 2 * radius * PI; // or diameter * PI;
std::cout << "Area: " << area << std::endl;
std::cout << "Circumference: " << circumference << std::endl;
}
Explanation:
The first line imports the read/write library. The rest should be self-explanatory.
std::cin is the input stream - we use it to get the diameter
std::cout is the output stream - we write the answers (and commentary) there.
std::endl is the special "character" informing the output stream that we want it to put a newline character (and actually print to the output - it might have been holding off on it).
the // in the circumference computation signifies a comment - the program simply ignores this. I've added it to tell the reader that the circumference could have been computed using the diameter,
Answer:
The absolute most decimating ransomware and Trojan malware variations rely upon vulnerabilities in the Windows Server Message Block (SMB) to proliferate through an association's system. Windows SMB is a convention utilized by PCs for record and printer sharing, just as for access to remote administrations.
A fix was discharged by Microsoft for SMB vulnerabilities in March 2017, yet numerous associations and home clients have still not applied it. So now, the unpatched frameworks permit dangers that exploit these vulnerabilities inside, helping dynamic malware crusades spread like Californian rapidly spreading fire.
SMB vulnerabilities have been so effective for danger entertainers that they've been utilized in the absolute most unmistakable ransomware episodes and refined Trojan assaults of the most recent two years. Truth be told, our item telemetry has recorded 5,315 discoveries of Emotet and 6,222 of TrickBot in business systems—two Trojan variations that are utilizing the SMB vulnerabilities—over the most recent 30 days alone.