76 296
Assignments Done
Successfully Done
In May 2019

Answer to Question #47698 in C++ for laraib

Question #47698
write a program to convert kilogram into grams by passing pointer as argument to the function
Expert's answer
#include <iostream>
using namespace std;
double convert(double* kilograms);
//main method
int main()
double kilograms;
//promt user to enter kilograms
cout<<"Enter kilograms: ";
//show result
cout<<kilograms<<" kilogram(s) = "<<convert(&kilograms)<<" gram(s).\n";
//exit program
return 0;
//function convert to convert kilogram to gram by passing pointer as argument to the function
double convert(double* kilograms){
return *kilograms*1000;

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions