Answer:
import math
x = float(input("Input a decimal number of your choice: "))
y=int(x)
x=x-y
print(math.fabs(x))
Explanation:
Answer:
Step1: Start
Step2: Initialize the count variable to zero
Step3: Initialize the sum variable to zero
Step4: Read a number say x
Step 5: Add 1 to the number in the count variable
Step6: Add the number x to the sum variable.
Step7: Is the count variable in the memory greater than 50?
If yes, display the sum: go to step 8.
If No, Repeat from step 4
Step8: Stop
Explanation:
It mainly just depends on if you "misuse" them.
Answer:
int count;
for (int i = 1; i <= 100; i++){
count = 0;
for (int j = 1; j <=i; j++)
if (i%j==0) count ++;
if (count == 2) cout << i << " ";
}