Program p1;
var a,b,c,d : integer; {i presume you give integer numbers for the values of a, b, c }
x1, x2 : real;
begin
write('a='); readln(a);
write('b='); readln(b);
write('c=');readln(c);
d:=b*b - 4*a*c
if a=0 then x1=x2= - c/b
else
if d>0 then begin
x1:=(-b+sqrt(d)) / (2*a);
x2:=(-b - sqrt(d))/(2*a);
end;
else if d=0 then x1=x2= - b /(2*a)
else write ("no specific solution because d<0");
writeln('x1=', x1);
writeln('x2=',x2);
readln;
end.
Answer:
All Rights Reserved, Some Rights Reserved, Public Domain
Explanation:
Answer:
Correct answer is:
communicate the purpose of the code that follows it.
Explanation:
Let have a look at each option
comment should give the reader the background of the programmer.
Comments are unable to do so.
Be written on every line
No, it is not need as comment are useful only to explain difficult or complex part of code.
communicate the purpose of the code that follows it.
yes, this option is true, as comments will give hints to programmer about the piece of code.
give information about how many hours it took to write the code
No, comments can answer it,
Answer:
const MAXNR=150;
let candidates = {};
for(let i=2; i<=MAXNR; i++) {
candidates[i] = true;
}
for(let p=2; p <= MAXNR; p++) {
if (candidates[p]) {
process.stdout.write(`${p} `);
// Now flag all multiples of p as false
i=2;
while(p*i <= MAXNR) {
candidates[p*i] = false;
i++;
}
}
}