#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float ht,inch,feet;
cout<<"Enter your height in centimeters : ";
cin>>ht;
feet=ht/30.48;
inch=ht/2.54;
cout<<"Height in feets : "<<feet;
cout<<"Height in inch : "<<inch;
getch();
}
Here you can find sample and simple c++ programs that are helpful for computer science students
thank u, athulsiri am a class 11 student and ur program helped me a lot :)
ReplyDeleteIt was helpful but after certain number of repetitions it got 'mad' i mean at 156 cm it shows 5.2 feet and 0.376 inches??
ReplyDeleteThen i inserted 182 and all it showed was 00?? It was great as well as disastrous
because it was a logical error.
DeleteDo it as an int. Int feet,outputinches, inches;
Deleteinput inches then
feet=inches/12 // this is called integer division
outputinches=inches%12 //% is the modulus operator.
I hope this might help you. I have even got the same task in my school. I am also presently in class 11 and studying computer science
Can you please show the output of the program become it's showing wrong in my Dev c++ user if you can show the output then I think it will be very helpful for me
Deletethanks
ReplyDeleteNo need
ReplyDeleteNo need
ReplyDeleteNice one bro i hope it will work...let me try it
ReplyDeleteHttp://damytechs.com
Quickly convert centimetres into inches (cm to inches) using the online calculator for metric conversions and more.
ReplyDeleteThank u a lot...
ReplyDeleteShow output also please
ReplyDeletePlease show the output become it's coming wrong. If u can show the output of the program I think then it will be very helpful for me
ReplyDelete