Answer:
The algorithm is as follows
1. Start
2. Declare Integer N
3. Input N
4. While N > 0:
4.1 Print(N%10)
4.2 N = N/10
5. Stop
Explanation:
This line starts the algorithm
1. Start
This declares an integer variable
2. Declare Integer N
Here, the program gets user input N
3. Input N
The while iteration begins here and it is repeated as long as N is greater than 0
4. While N > 0:
This calculates and prints N modulus 10; Modulus of 10 gets the individual digit of the input number
4.1 Print(N%10)
This remove the printed digit
4.2 N = N/10
The algorithm ends here
5. Stop
<u>Bonus:</u>
The algorithm in Python is as follows:
<em>n = 102</em>
<em>while n>0:</em>
<em> print(int(n%10))</em>
<em> n= int(n/10)</em>
<em> </em>
Answer: i’m thinking it’s reviewer
Explanation:
Answer:
Option(d) i.e "storing a float in an int" is the correct answer for the given question.
Explanation:
- Typecast is used for the changing the one datatype to the another datatype Their are two types of casting
1 implicit
In this typecast we change the smaller datatype into the larger datatype.
For example
int to float
2 Explicit
In this typecast we change the larger datatype into the smaller datatype in an explicit manner.
For example
float to int.
- in the given question we required the casting in the option(d) i.e "storing float in an int" That's why this option is correct and all other options are incorrect.