Connect with one of the following accounts


Please wait while we redirect...

Views: 192   

Following program shows you how to convert kilograms to grams.
In this program we get kilograms from user, once we get those we need to multiply with 1000 so that we get in grams

#include <iostream>
#include <math.h>

int main() {
    float kilograms;
    std::cout << "Please enter kilograms:";
    std::cin >> kilograms;
    float grams = kilograms * 1000;
    std::cout << grams << " Grams";


Please enter kilograms: 5
5000 Grams

On By

Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News