By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Why do I keep getting this message: error C2065: 'centrigrade' : undeclared identifi

P: n/a
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. using namespace std;
  3. void main()
  4. {
  5.     int centigrade;
  6.     float calc_Fahrenheit;
  7.     cout << " Type in a number for centrigrade: ";
  8.     cin >> centrigrade;
  9.     calc_Fahrenheit = 1.8 * centrigrade + 32;
  10.     cout << "Fahrenheit converted to entrigrade is: " << calc_Fahrenheit << " degrees " << ",\n";
  11.     system("Pause");
  12. }
Sep 30 '10 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
Line 8 you get input into the variable centrigrade but line 5 you actually declare a variable called centigrade.


Next time please do not just post code, post code plus a description of your problem plus the full text of the errors you are getting.
Sep 30 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.