Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,423 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,268 people online right now. Registration is fast and FREE... Join Now!




how to kg to lbs in c++ need it fast for test

 
Reply to this topicStart new topic

how to kg to lbs in c++ need it fast for test, help

neojin24
7 Feb, 2008 - 01:11 AM
Post #1

New D.I.C Head
*

Joined: 7 Feb, 2008
Posts: 1

please help me out i have a test to remember that was given to me by the teacher was sick ph34r.gif

well it wont compile and my editor sucks i hate not having fast internet


#include <iostream>
using namespace std;
float lbstokg(float);

int main()
{
float lbs,kgs;
cout<<”enter your weight in lbs:”;
cin>>lbs;
kgs=lbstokg(lbs);
cout<<”your weight in kg is “<<kgs<<end1;
return 0;
}
//……………………………………………..
//lbstokg()
//converts pounds to kg
float lbstokg(float pounds)
{
float kg=0.453592*pounds;
return kg;
}

This post has been edited by neojin24: 7 Feb, 2008 - 01:40 AM
User is offlineProfile CardPM
+Quote Post

Jayman
RE: How To Kg To Lbs In C++ Need It Fast For Test
7 Feb, 2008 - 01:33 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,298



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks.
User is online!Profile CardPM
+Quote Post

MorphiusFaydal
RE: How To Kg To Lbs In C++ Need It Fast For Test
7 Feb, 2008 - 02:10 AM
Post #3

D.I.C Lover
Group Icon

Joined: 12 May, 2005
Posts: 1,212



Thanked: 15 times
Expert In: Hardware, Networking

My Contributions
Line 10: you have "end1" (end one). This needs to be "endl" (end L). I suspect this is why it was erroring out. In future; please give us the error that your compiler says. Saves us the trouble of having to fire up vim and gcc to see for ourselves.

Also. code.gif

Makes it *much* easier to read.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 11:13AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month