Home › Forums › C Programming › Problem solving few assignments in C language › Reply To: Problem solving few assignments in C language
August 10, 2007 at 5:14 am
#3237
bhavin
Participant
Q.21 answer:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include<stdio.h><br /> #include<conio.h><br /> int convert(float a);<br /> void main()<br /> {<br /> float k;<br /> clrscr();<br /> printf("Enter any wieght in KG:");<br /> scanf("%f",&k);<br /> convert(k);<br /> getch();<br /> }<br /> int convert(float r)<br /> {<br /> int a;<br /> a=r*1000;<br /> printf("nGram Value is = %dgrams",a);<br /> return(0);<br /> } |
output:
enter any weight in kg 2
gram value is = 2000grams