Write a program to calculate the BMI of a person using the
formula BMI = weight/height2.
Answer Posted / nitin kalambe
void main()
{
float BMI,weight,height;
cout<<"Enter you weight and height"<<endl;
cin>>weight>>height;
BMI=weight/height*height;
cout<<"Your BMI is "<<BMI;
getch();
}
| Is This Answer Correct ? | 7 Yes | 6 No |
Post New Answer View All Answers
Can you pass a vector to a function?
what is multi-threading in C++?
What's c++ used for?
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include Out of fgets() and gets() which function is safe to use? Is c++ used anymore? In which header file does one find isalpha()
a) conio.h
b) stdio.h
c) ctype.h What is an adjust field format flag? Will a catch statement catch a derived exception if it is looking for the base class? How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)? What is the difference between *p++ and (*p)++ ? What is a friend function in c++? Define a nested class. What is a down cast? Show the declaration for a pointer to function returning long and taking an integer parameter.