FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 109   



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 <stdio.h>

int main(void) {
    float kilograms;

    printf("Please enter kilograms:");
    scanf("%f", &kilograms);

    float grams = kilograms * 1000;

    printf("%f Grams", grams);
}

Output:

Please enter kilograms: 8
8000.000000 Grams



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News