Pages

Write a program in c language to convert weight in grams from kilograms using function [Updated]

Wednesday, 10 July 2013

#include<stdio.h>
#include<conio.h>
int grams(int); // function prototype
int main()
{
    int kg,gm;
    printf("Enter the weight in kilogram: ");
    scanf("%d",&kg);
    gm=grams(kg);
    printf("%d Kilograms = %d Grams\n", kg,gm);
    getch();
}
int grams(int weight) //function defination
{
    return weight*1000;
}

 

Search Box

Most Reading

Contact Form

Name

Email *

Message *