Home Forums C Programming Problem solving few assignments in C language Reply To: Problem solving few assignments in C language

#3237
bhavin
Participant

Q.21 answer:

#include
#include
int convert(float a);
void main()
{
float k;
clrscr();
printf("Enter any wieght in KG:");
scanf("%f",&k);
convert(k);
getch();
}
int convert(float r)
{
int a;
a=r*1000;
printf("nGram Value is = %dgrams",a);
return(0);
}

output:
enter any weight in kg 2

gram value is = 2000grams