Answer:
In Python:
N = int(input("Positive integer: "))
if N > 0:
flag = False
for i in range(1,N+1):
if i * i == N:
flag = True
break
print(str(flag))
else:
print("Positive integer only")
Explanation:
N = int(input("Positive integer: "))
If the number is positive
if N > 0:
This initializes a boolean variable to false
flag = False
This iterates from 1 to the input integer
for i in range(1,N+1):
This checks if th number is a square of some integer
if i * i == N:
If yes, flag is set to true
flag = True
The loop is exited
break
This prints either true or false, depending on the result of the loop
print(str(flag))
If otherwise, that the number is not positive
<em>else:</em>
<em> print("Positive integer only")</em>
Answer:
/*
I don't know what language you're using, so I'll write it in javascript which is usually legible enough.
*/
console.log(buildSequence(30));
function buildSequence(maxVal){
maxVal = Math.abs(maxVal);
var n, list = [];
for(n = 1; n < maxVal; n++){
/*
to check for odd numbers, we only need to know if the last bit
is a 1 or 0:
*/
if(n & 1){ // <-- note the binary &, as opposed to the logical &&
list[list.length] = n;
}else{
list[list.length] = -n;
}
}
return list.implode(',');
}
<span>You can change the identation of text in Powerpoint by right clicking on the list item and selecting, "Format Text". On the paragraph tab, you can adjust the indentation before text as given in inches.</span>
Computer Network, surely!
"Network" implies combination of all these computers!