Answer:
The answer is A) Pen Drive.
Explanation:
A pen drive is a device which can be used to store data and move it somewhere else.
Answer:
def main():
n = int(input('Enter the value of the variable n:'))
k=2;
totalSum = 0
print('The list of the prime numbers are as follows:')
while k <= n:
totalSum = totalSum+is_prime(k)
k=k+1
print('Total sum of the prime numbers:',totalSum)
def is_prime(k):
primeNumber = 0
i=1
while i<=int(k):
if (k % i) == 0:
primeNumber = primeNumber + 1
i=i+1
if(primeNumber==2):
print(k)
return k;
else:
return 0;
main()
Explanation:
- Run the while loop until k is less than n.
- Determine if the variable k is prime then add it to the totalSum variable.
- Increment the value of k by 1.
- Create a function isPrime to check whether the number is prime or not by determining the factors of k which can be found using the modulus operator.
-
Call the main function at the end.
Answer:
The advantages of a digital darkroom is that it allows the photographer to make minor changes to improve a photograph. The disadvantage is that the more you want your picture to come out better you would need to waste your time or be patient to get the picture and buy a better camera.
Answer:
// Program is written in C++ programming language
// Comments are used for explanatory purpose
// Program starts here
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
// Variable Declarations
int years; double amount;
// Get input for loan amount and period (in years)
cout<<"Loan Amount: ";
cin>>amount;
cout<<"Number of Years: ";
cin>>years;
// Display table header
cout<<"Interest Rate Monthly Payment Total Payment";
// Calculate and display interest rates
// Start iteration
for (double i = 5.0; i <= 8; i += 0.125) {
cout<<i;
// Calculate Monthly Interest Rate
double monthlyRate = i / 1200;
// Calculate and Print Monthly Payment
double monthlyPay = amount * monthlyRate / (1 - 1 / pow(1 + monthlyRate, years * 12)); cout<<monthlyPay; cout<<"\n"<<(monthlyPay * 12) * years);
}
return 0;
}
// End of program