Hi all,
sorry to disturb u guys again.
i having a problem with my study.
i have no no idea how to solve the question.
can any1 help me to solve it?
thank you very much.
The reading in the page of this is hard for me to comprehend. but I'm guessing you're working with arrays.... obliviously.
Just out of curiosity what compiler are you using? and the OS.
That helped me a lot when I was learning arrays.
Small chuckle to myself....I'm 14 and I'm guessing this guy is in collage..... and yet I'm failing in school.
Hey tuck I've got a question for you. I'm stuck on this code right now. I'm trying not to look in any of my books or anything. but I compiled this code with no errors and it closes when you enter a number
Code:
#include <iostream>
using namespace std;
int main ()
{
int i;
cout << "Please enter the degrees in Celcius ";
cin >> i;
cout << "That number in fahrenheit is: " << i*1.8 + 32 << ".\n";
return 0;
}
and for some reason it's not coming out right. its going to keep me up all night that a super simple code is not working.
#include <iostream>
using namespace std;
int main ()
{
double i;
cout << "Please enter the degrees in Celcius ";
cin >> i;
cout << "That number in fahrenheit is: " << (i*1.8)+32 << ".\n";
return 0;
}
I'm using CodeBlocks with the Ming G++ compiler. Are you sure it isn't just the window shutting down. Try changing your code to,
Code:
#include <iostream>
using namespace std;
int main ()
{
int i;
while(1){
cout << "Please enter the degrees in Celcius ";
cin >> i;
cout << "That number in fahrenheit is: " << i*1.8 + 32 << ".\n";
}
return 0;
}
When you want to quit out of the above press Ctrl-C.
Oyyyyy, not all compilers are same, some follow standards, some bend them:
Try this:
Code:
#include <iostream>
using namespace std;
int main (){
double i;
cout << "Please enter the degrees in Celcius: ";
cin >> i;
cout << "That number in fahrenheit is: " << (i*1.8)+32 << ".\n";
system("pause");
return 0;
}
This is really really pissing me off. Every program i write and compile it closes when you enter a number in the console and hit "enter". I googled this and nothing relative to this topic is around.