| | |
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 based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets







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