Answer:
Explanation:
In the above expression 7 is divided by 2, so the quotient is 3 and the remainder is 1. Approach: Divide the dividend by the divisor using / operator. Both dividend and divisor can be of any type except string, the result will also be computed accordingly. Get the remainder using % operator.
Answer:
The statement is as follows:
print("{0:,.1f}".format(number))
Explanation:
Required
Statement to print 1234567.456 as 1,234,567.5
To do this, we make use of the format keyword, and we set the print format in the process.
To round up number to 1 decimal place, we use the following format:
"{0:,.1f}"
To include comma in the thousand place, we simply include a comma sign before the number of decimal place of the output; i.e. before 1
"{0:,.1f}"
So, the print statement is:
print("{0:,.1f}".format(number))
Answer:
Do your work
Explanation:
Just focus on your school work, don't do anything that will get you in trouble. make friends, make friends with teachers. hope this helped
Answer:
// here is code in C++(bmi.cpp).
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
float weight,height;
cout<<"enter the weight(in kilograms):";
//read the weight
cin>>weight;
cout<<"enter the height(in meters):";
//read the height
cin>>height;
// calculate the bmi
float bmi=weight/(pow(height,2));
// print the body-mass index with two decimal places
cout<<"BMI is: "<<fixed<<setprecision(2)<<bmi<<endl;
return 0;
}
Explanation:
Read the weight from user and assign it to variable "weight",read height and assign it to variable "height".Then find the body-mass index as (weight/height^2).Here weight should be in kilograms and height should be in meters.
Output:
enter the weight(in kilograms):75
enter the height(in meters):1.8
BMI is: 23.15