Skip to main content
gamedev.net
🔒 Locked

ms dos c++ program problem

Started by pizzaman Oct 21, 2000 at 8:58 PM 2 replies 300+ views
Original Post
pizzaman
pizzaman
my program i just made with my friend has no errors and runs, but not the right way. it asks for radius and then if your sure you want to continue. 1 for yes 2 for no. after you choose yes it says ok the celsius is. press any key to continue. it should though convert farenheight to celsius or if you press n terminate the application. heres the code #include int main() { cout.setf(ios::left); cout<<"Farenheigh to celsius"; cout<<"\n"; cout.width(10); cout<<"by --sn design--"; char farenheight; cout<<"Enter farenheight> "; cin>>farenheight; cout<<"would you like this special thing converted to celsius?"<>reply; if(reply==1) cout<<"ok then lets do this "; else if(reply==2) cout<<"ok then screw you!"; char one; one=farenheight-32; char two; two=5/9*one; cout<<"The celsius is"; cout<
i am the best
terminate
terminate
try useing floats or double instead of chars when converting Farenheight to celcius.

Whats a pretty girl like you doing in a dirty mind like mine?
Those who dance are considered insane by those who cannot hear the music.
Scooter
Scooter
why not? :


.....
cout<<"would you like this special thing converted to celsius?"< cout<<"1 for yes 2 for no";

int reply;
cin>>reply;

if(reply == 1)
{
cout<<"ok then lets do this ";

char one;
one=farenheight-32;
char two;
two=5/9*one;
cout<<"The celsius is";
}

else if(reply == 2)
cout<<"ok then screw you!";


........

We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
terminate
terminate
use double instead of chars
and clean up ur code a bit

    
#include <iostream.h>

int main()
{
double farenheight;
double reply;
double one;
double two;
cout<<"Farenheigh to celsius";
cout<<"\n";
cout<<"by --sn design--";

cout<<"Enter farenheight> ";
cin>>farenheight;
cout<<"would you like this special thing converted to celsius?\n ";
cout<<"1 for yes 2 for no\n";


cin>>reply;
if(reply==1)
{
cout<<"ok then lets do this \n";
one=farenheight-32;
two = one * 5/9;
cout<<"The celsius is ";
cout << two;
}
else if(reply==2)
cout<<"ok then screw you!";





return 0;
}

this works

Whats a pretty girl like you doing in a dirty mind like mine?
Those who dance are considered insane by those who cannot hear the music.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.