1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mashutka [201]
1 year ago
10

Write a program that prompts the user for two numbers then outputs the result of dividing the first number by the second number

Computers and Technology
1 answer:
Rainbow [258]1 year ago
5 0

The program is

num = int(input("Enter Numerator "))

den = int(input("Enter Denominator "))

print("quotient is ",str(num//den)," remainder is ", str(num%den))

<h3>How to create a division sign in HTML?</h3>

To create a division sign ( ÷ ) in HTML you can use any of the following codes.

&divide;

&div;

&#247;

<h3>How to divide in computer programming?</h3>

Perl code

use strict;

my $first = 15;

my $second = 5;

my $answer = $first / $second;

print "You get $answer if you divide $first by $second";

When the script above is run, it displays "You get 3 if you divide 15 by 5" on the screen.

To learn more about programming, refer

https://brainly.ph/question/4743

#SPJ4

You might be interested in
Part 1: 1) Write a C program getPhoneNumber.c that accepts a phone number from the user in the form XXX-XXX-XXXX, and then displ
Allushta [10]

Answer:

Following are the program, which can be below:

#include <stdio.h> //defining header file

#include <string.h>//defining header file

int main() //defining main method

{  

int x=0,y=0,l=0; //defining integer variable

char phone_number[32] = {'\0'}; //defining char array

printf("Enter a date(xxx-xxx-xxxx): \n "); //print message

printf("Example: 000-000-0000 \n :"); //print message

scanf("%s",phone_number); // taking input from user

printf("%s\n",phone_number); //print number

for(x=0; phone_number[x]; x++) // check character by character

{

if(x==0) // put ( on first character

{

l = strlen(phone_number); //calculate length  

phone_number[l] = '\0'; //check number  

for(y=l; y>=1; y--) //loop to calculate a value

{

phone_number[y] = phone_number[y-1]; //holding value in array

}

phone_number[y] = '('; //assigning bracket

}

if(phone_number[x] == '-') // put ) at first -

{

phone_number[x] = ')'; //assigning bracket

break;

}

}

printf("You entered %s\n",phone_number); //print all value with brackets

}

Output:

Enter a date(xxx-xxx-xxxx):  

Example: 000-000-0000  

:011-123-4567

011-123-4567

You entered (011)123-4567

Explanation:

The description of the above program can be defined as follows:

  • In the above program three integer variable "x, y, and l" and a character array "phone_number" is declared.
  • In the char, variable user input the value and print its value by using the print function.
  • In the next line, a for loop is declare, that checks user input value character by character and counts its length by using the strlen() method, inside the loop a conditional statement is used.
  • In the condition statement check, the values are not equal to null and provide brackets in the inserted value.
8 0
3 years ago
Time-management techniques work most effectively when performed in which order?
Sholpan [36]

Answer:

study-time survey, project schedule, prioritize tasks, reward system.

Explanation:

Time management can be defined as a strategic process which typically involves organizing, planning and controlling the time spent on an activity, so as to effectively and efficiently enhance productivity. Thus, when time is properly managed, it avails us the opportunity to work smartly rather than tediously (hardly) and as such making it possible to achieve quite a lot within a short timeframe. Also, a good time management helps us to deal with work-related pressures and tight schedules through the process of properly allocating the right time to the right activity.

Hence, time-management techniques work most effectively when performed in the following sequential order; study-time survey, project schedule, prioritize tasks, and designing (creating) a reward system.

4 0
3 years ago
Write a program that reads a number and prints all of its binary digits: print the remainder number % 2, then replace the number
allsm [11]
If you print the binary digits just like that, they'll be in the wrong order (lsb to msb). Below program uses recursion to print the digits msb to lsb. Just for fun.

void printBits(unsigned int n)
{
   if (n > 1) {
      printBits(n >> 1);
   }
   printf((n & 1) ? "1" : "0");
}

int main()
{
   unsigned int number;
   printf("Enter an integer number: ");
   scanf_s("%d", &number);
   printBits(number);
}

5 0
4 years ago
Which is an appropriate strategy for using a workplace blog?
OLEGan [10]

Answer:

a

Explanation:

8 0
3 years ago
Answer the following Python Interview questions • How is Python an interpreted language? • What is the difference between Python
8_murik_8 [283]

Answer:

1. Python is called as interpreted language. However as a programming language it is not fully compiled nor interpreted language. Python program runs from direct source code which makes it byte code interpreted.

An Interpreter is the one which takes the code and performs the actions specified in the code. It turns the code into intermediate language which is again translated to machine language understood by the processor. Interpreted or compiled are the property of the implementation and not of the language.

2. Array : It is a collection of same data type elements stored at contagious memory location. It is handled in python with module array. All the elements of array must be of same data type. In order to manipulate same data types arrays are used.

Ex: array1 = a.array ('i', [10, 20, 30]) this is a array of integer type.

Lists : Python lists are ordered data structure and are like non homogeneous dynamic sized arrays. It may contain integers, strings, boolean, or objects.

Ex: List1 = [70, 89, 98] , List2 = ["Rose", "Lilly", "Jasmine"]

List3 = [1, 10, 100, 'Test', 'Test1']

Tuple : It is a collection of objects separated by commas and they are immutable. It is static which makes them faster.

Ex: tupule1 = ('element1', 'element2')

List and Tuple in Python are the class of data structure. The list is dynamic, whereas tuple has static characteristics.

Lists are mutable but tuples are not.

tuples are mainly used to access the elements where as lists are used in operations like insertion and deletion.

Iterations are time consuming in list where as it is faster in tuples.

tuples don't have inbuilt methods but list has many builtin methods.

tuples takes slightly less memory that lists in Python

Records: Records data structure will have fixed number of fields and each field may have a name and different type. Immutable records are implemented using named tuple.

3. Syntax of slice in python is list[<start>:<stop>:<step>] and it can be used on tuples and lists.

so X [::-1] means that it will start from the end towards the first element by taking each of the elements.

for ex: X = '9876'

X [::-1] will result in '6789'.

Means it will reverse all the elements in the array.

4. Items of list can be shuffled with the random.shuffle() function of a random module.

Syntax is : random.shuffle(x, random)

x- It is a sequence to shuffle and can be list or tuple.

random- it is a optional argument which returns random float number between 0.1 to 1.0.

5. range() – Range function returns a range object which is a type of iterable object.

xrange() – xrange function returns the generator object that can be used to display numbers only by looping. Only particular range is displayed on demand and hence called “lazy evaluation“.

• Return type of range () is range object whereas that of xrange() is xrange object.

• Variable to store the range using range () takes more memory but xrange takes comparative less memory.

• Range returns the list but xrange returns the xrange object. Hence operations on list can be applied for range but not on xrange.

• Xrange is faster to implement than range as xrange evaluates only generator objects.

• Xrange is depreciated in Python 3 and above.

For ex :

x = range (10, 100)

y= xrange (10, 100)

#To know the return type we can print it

print ( return type of range () is : “)

print (type (x))

print ( return type of xrange () is : “)

print (type (y))

Output will be list and xrange respectively.

6. NumPy's arrays are more compact than Python lists

reading and writing items is also faster with NumPy.

Memory taken by python lists are way higher than NumPy arrays.

Python lists don’t support vectorized operation.

Since lists can contain objects of different types its type information must be stored and executed every time operation is performed on it.

Memory taken by python lists are a lot higher than that of NumPy Arrays.

Reading and writing of elements in NumPy arrays are faster than lists.

NumPy arrays are compact and accumulate lesser storage.

Numpy is convenient and efficient.

For ex :

Metrics operations are easy in NumPy.

Checkerboard pattern can be done using NumPy.

7. Attached as Image

8. split() method returns a list of strings after breaking the given string by the specified separator. It is splitting of string into list with each word is a list item.

Syntax : str.split ( separator, maxsplit)

Separator : its is delimiter used and by default whitespace is used as separator.

Maxsplit : Maximum number of times to split the string. By default it has no limit.

For ex:

text = 'apples and oranges are different '

print(text.split())

output will be : ['apples', 'and', 'oranges', 'are', 'different' ]

Explanation:

7 0
3 years ago
Other questions:
  • For a panoramic photograph, you will more than likely want to control the exposure of the photograph yourself rather than lettin
    11·1 answer
  • The computer that provides information or resources to the client computers on the network is called a(n) ________.
    5·1 answer
  • Which of the following refers to rules written by an organization or entity to guide behavior in a particular setting or situati
    7·2 answers
  • Once a graph has been created, you would need to start over to make any changes to it?
    5·1 answer
  • Joshe is a project leader in Tiran technologies. 75 developers and analysts work under his supervision on several projects. Thes
    12·1 answer
  • Omega Software Inc. is currently running a training program for employees to upgrade their software skills so that they are able
    10·1 answer
  • ou have a company network that is connected to the internet. You want all users to have internet access, but you need to protect
    13·1 answer
  • If you can name this you get 15 points: ↑↑↓↓←→←→βα
    10·1 answer
  • Help with Java, please!
    5·1 answer
  • What is containment and why is it part of the planning process
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!