Write a program to calculate the BMI of a person using the
formula BMI = weight/height2.
Answers were Sorted based on User's Feedback
Answer / g.durga
main()
{
float bmi;
int weight,height;
printf(enter weight and height");
scanf("%d%d",&weight,&height);
bmi=weight/height;
print("%f",bmi);
getch();
}
| Is This Answer Correct ? | 12 Yes | 6 No |
Answer / 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 |
What is the use of ‘using’ declaration?
What do you mean by funtion prototype?
What is a container class?
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
Differentiate between realloc() and free().
What is a map in c++?
How a new operator differs from the operator new?
Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1
What are the five types of inheritance in C++?
Do class declarations end with a semicolon?
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].