| | |
need help with calculations
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 19
Reputation:
Solved Threads: 0
hello this code seems to give me wrong results and i carnt figure out why 

C++ Syntax (Toggle Plain Text)
#include <iostream> int main() { float pi = 3.142; char area; float diameter; area = diameter * pi; std::cout << "Hello. Please imput the diameter of your circle... "; std::cin >> diameter; std::cout << "The area of your circle is " << 'area' << ".\n"; std::cin.get(); return 0; }
•
•
Join Date: Jun 2009
Posts: 19
Reputation:
Solved Threads: 0
C++ Syntax (Toggle Plain Text)
#include <iostream> int main() { float pi = 3.142; char area; float diameter; std::cout << "Hello. Please imput the diameter of your circle... "; std::cin >> diameter; area = diameter * pi; std::cout << "The area of your circle is " << area; std::cin.get(); return 0; }
gives me a wierd symbol for the area?
why is this i cannot see anything wrong with my code (newbie) ![]() |
Similar Threads
- Trouble writing code for arithmetic calculations of complex numbers (C++)
- Calculations, Variables and Constants - Please help (VB.NET)
- Price Calculations (C#)
- random number generator and calculations (Java)
- Calculations (C++)
- Mortgage Calculations (C++)
- calculations in java (Java)
- Java Multidimensional Arrays (Java)
- simple calculations How? intHrlyRate, etc Help me (ASP)
Other Threads in the C++ Forum
- Previous Thread: pure virtual function in constructor
- Next Thread: installing GTK+ on Ubuntu
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets







everything works fine now, except the program flashes off straight away lol 