Answer:
input.open("rawdata");
input>>datum;
input.close();
Explanation:
ifstream objects maintain a filebuf object as their internal stream buffer, and perform operations like input/output on the available associated files.
In above statements.
input.open("rawdata");
- The associated file named rawdata is opened.
input>>datum;
- The integer from the file is read into already declared variable datum.
input.close();
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>
He wouldn’t answer the context for the discussion
01001001 00100000 01100001 01100011 01110100 01110101 01100001 01101100 01101100 01111001 00100000 01110101 01110011 01100101 01100100 00100000 01100001 00100000 01000010 01101001 01101110 01100001 01110010 01111001 00100000 01100011 01101111 01100100 01100101 00100000 01000011 01101111 01101110 01110110 01100101 01110010 01110100 01100101 01110010 00100000 01101100 01101101 01100001 01101111