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
lbvjy [14]
3 years ago
11

Given two int variables distance and speed, write an expression that divides distance by speed using floating point arithmetic,

i.e., a fractional result should be produced. (NOTE: Simply write an expression that performs the calculation. Do not assign the result to a variable.)
Computers and Technology
1 answer:
Vsevolod [243]3 years ago
7 0

Answer:

float(distance) / speed

Explanation:

Given the variable <em>distance</em> and <em>speed</em> in a program that hold a integer value respectively.  We can perform the division between the two variable using / operator. Since both distance and speed are integers, we need to convert one of them to float type to perform the floating point arithmetic. Otherwise the division output will be rounded up to the nearest integer which is not a desired result.

You might be interested in
Write a program in C which will open a text file named Story.txt. You can create the file using any text editor like notepad etc
ddd [48]

Answer:

See explaination

Explanation:

#include <stdio.h>

#include <stdlib.h>

int main()

{

FILE * file_object;

char file_name[100];

char ch;

int characters=0, words=0;

printf("Enter source file name: ");

scanf("%s", file_name); //asking user to enter the file name

file_object = fopen(file_name, "r"); //open file in read mode

if (file_object == NULL)

{

printf("\nUnable to open file.file not exist\n"); //check if the file is present or not

}

while ((ch = fgetc(file_object)) != EOF) //read each character till the end of the file

{

if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\0') //if character is space or tab or new line or null character increment word count

words++;

else

characters++; //else increment character count this assures that there is no spaces count

}

printf("The file story.txt has the following Statistics:\n"); //finally print the final statistics

if (characters > 0)

{

printf("Words: %d\n", words+1); //for last word purpose just increment the count of words

printf("Characters (no spaces): %d\n", characters);

}

fclose(file_object); //close the file object

return 0;

}

6 0
3 years ago
When driving, your attention is __________.
maks197457 [2]
It is c hope I helped
7 0
3 years ago
Read 2 more answers
You send a report to your boss for feedback and she returns it to you with her edits noted in the electronic file. This Word fea
Lesechka [4]
Edits in the document are called, C. Track changes
3 0
3 years ago
Read 2 more answers
Glass, rubber, porcelain, and paper are examples of electrical A. conductors. B. insulators. C. grounds. D. batteries.
irga5000 [103]
B.Insulators I think
7 0
3 years ago
Read 2 more answers
Use the table on the right to convert from hexadecimal to binary.
OLga [1]

Answer:

what is the question and answers?

6 0
3 years ago
Read 2 more answers
Other questions:
  • Your friends know that you understand a lot about computers, both the technical details of how they operate as well as informati
    12·1 answer
  • Fill the validateForm function to check that the phone number contains a number (use the isNaN function) and that the user name
    10·1 answer
  • Which is the process that a wireless router uses to translate a private ip address on internal traffic to a routable address for
    14·1 answer
  • Explain why, with fast moving mobiles, speed is more dominant in characterizing the use mobility pattern than direction?
    8·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
    6·1 answer
  • A(n) __________ describes a set of well-defined logical steps that must be taken to perform a task
    5·1 answer
  • Given two variables, is Empty of type boolean, indicating whether a class roster is empty or not, and number Of Credits of type
    10·1 answer
  • It keeps saying “something is going wrong oops!” when i click on my brainly notifications what do I do
    9·1 answer
  • Create detailed pseudocode for a program that calculates how many days are left until Christmas, when given as an input how many
    15·1 answer
  • Each AWS region is composed of two or more locations that offer organizations the ability to operate production systems that are
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!