64 642
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #16346 in C++ for Sunny

Question #16346
Write a program that converts kilogram into grams by using a user defined function. Use the return statement in the program.
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions