Answer:
value=int(input("Enter the value from where the user wants to starts: "))#Take the value from the user.
i=1#intialize the value of a variable by 1.
while(value<1000) and (i<9):#while loop which prints the value.
print(value,end=" ")# print the value.
value=value*2#calculate the value to print.
i=i+1#calculate the value for the count.
Output:
If the user enter 5, then the output is : "5 10 20 40 80 160 320 640".
If the user enter 5, then the output is : "3 6 12 24 48 96 192 384".
Explanation:
- The above code is in python language, in which the first line of the program is used to render a message to the user, take the input from the user and store it into value variable after converting it into an integer.
- Then the loop will calculate the double value and then it prints the value with the help of print function.
- The end function puts the spaces between numbers.
Computer software, or simply software, is a part of a computer system that consists of data or computer instructions, in contrast to the physical hardware from which the system is built. In computer science and software engineering, computer software is all information processed by computer systems, programs and data. Computer software includes computer programs, libraries and related non-executable data, such as online documentation or digital media. Computer hardware and software require each other and neither can be realistically used on its own.
Answer:
#include <iostream>
using namespace std;
int main() {
int nhits,nbats;//declaring number of hits and number of bats..
cin>>nhits>>nbats;//promting nhits and nbats..
float perc=(float(nhits)/nbats)*100;//calculating percentage..
if(perc>300)//checking eligibility.
{
cout<<"Eligible for ALL STARS GAME"<<endl;
}
else
cout<<"NOT Eligible"<<endl;
return 0;
}
Output:-
55
7
Eligible for ALL STARS GAME.
Explanation:
I have taken two integer variables nhits and nbats for number of hits and number of bats.Prompting them from the user.After that i am calculating the percentage and it needs to be a float variable.So I have done typecasting for the that converting 1 integer to float so that the answer will come in float.After that checking the eligibility and printing the message.
Answer:
1. Launch the File Open dialog. In the File menu, select the Open menu item.
2. Open the folder containing the desired file.
Select the desired file within the folder.
3. (Optional) Specify a file format type.
4. (Optional) Specify the character encoding.
5. Click on the Open button.