Answer to Question #16346 in C++ for Sunny
Write a program that converts kilogram into grams by using a user defined function. Use the return statement in the program.
1
2012-10-16T09:44:03-0400
#include<iostream>
using namespace std;
float kg, g;
int kgtog(float kg){
& return kg*1000;
}
void main(){
cout<<"enter a value: ";
cin>>kg;
cout<<kg<<" kg = "<<kgtog(kg)<<" g\n";
system("pause");
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment