Sum of Prime Numbers from M to N
Given two integers M and N, write a program to print the sum of prime numbers from M to N.Input
The first line of input will contain a positive integer (M).
The second line of input will contain a positive integer (N).Output
The output should be a single line containing the sum of prime numbers from M to N.Explanation
For example, if the given M and N are 5 and 11, as all the prime numbers from 5 to 11 are 5, 7, and 11. So the output should be sum of these primes (5+7+11), which is 23.
Similarly, if the given numbers are M is 18 and N is 40, as all the prime numbers from 18 to 40 are 19, 23, 29, 31,and 37. So the output should be sum of these primes (19+23+29+31+37), which is 139.
Sample Input 1
5
11
Sample Output 1
23
Sample Input 2
18
40
Sample Output 2
Shift Numbers - 2
Given a string, write a program to move all the numbers in it to its start.Input
The input will contain a string A.Output
The output should contain a string after moving all the numbers in it to its start.Explanation
For example, if the given string A is "1good23morning456", the output should be "123456goodmorning", as it contains numbers at the start.
Sample Input 1
1good23morning456
Sample Output 1
123456goodmorning
Sample Input 2
com876binat25ion
Sample Output 2
87625combination
donut has two circle. outer circle and inner circle. calculate shaded area of donut. outer area minus area minus area of inner circle. ask user to insert radius then calculate area.
Define a class Flight with the following specifications:
Private Members a data member are
Flight number of type integer A data member Destination of type string A data member Distance of type float A data member Fuel of type float A member function CALFUEL() to calculate the value of Fuel as per the following criteria
Distance Fuel
<=1000 500
more than 1000 and <=2000 1100
more than 2000 2200
Public Members
FEEDINFO() A function FEEDINFO() to allow user to enter values for Flight Number, Destination, Distance & call function CALFUEL() to calculate the quantity of Fuel. SHOWINFO() A function SHOWINFO() to allow user to view the content of all the data members. (Implement the concept of class and objects)
Given a string, write a program to return the sum and average of the numbers that appear in the string, ignoring all other characters.
explanation of OSI model
identification of end device requirements
Write a program that will accept the currency value and the name of the country and will display the equivalent in U.S. dollar, based on the given list:
COUNTRY CURRENCY U.S. DOLLAR EQUIVALENT
British Pound 0.6 U.S. dollar
Canadian Dollar 1.3 U.S. dollar
Japanese Yen 140 U.S. dollar
German Mark 1.7 U.S. dollar
Philippines Peso 53 U.S. dollar
Write a program using string functions that will accept the name of the country as input value and will display the corresponding capital. Here is the list of the countries and their capitals.
COUNTRY CAPITAL
Canada Ottawa
United States Washington D.C.
U.S.S.R. Moscow
Italy Rome
Philippines Manila
Write a program using standard string functions that accepts a price of an item and display its coded value. The base of the key is: X C O M P U T E R S 1 2 3 4 5 6 7 8 9 Sample input/output dialogue: Enter price: 489.50 Coded value: PRS.UX