I read all the sections of identifiers and conditional structures but I am still having a problem in creating a program.I want to run a program that calculates the area of circle while asking for the radius from the users using float.and it should not stop unless the user ask it to stop .
I will be thankfull if you tell me this .
Please answer this question too !
I am still having a problem in creating a program.I want to run a program that calculates the area of circle while asking for the radius from the users using float.
thanks and best regards !
@seymore15074
I prefer using while(true) so that I don't have to use an extra variable and because I can break it any time (without having to reach the next loop).
Interesting. I work under coding standards that forbid breaks; possibly for maintanability concerns. Also forbidden are multiple returns from a function, jumps, etc. It's one of the things in their standards that I agree with. Thanks for the input.
@masiht
If you have not started your assignment, begin by making an ordered list of what you have to do. Then start coding the basic structure of the program. When you encounter problems, post what you have, and we'll help you out.
int main ()
{
double r; // radius
double area;
cout <<"enter the radius value";
cin >>r;
area = PI * r*r;
cout << circle;
return 0;
}
this program is giving this errror
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\Users\Pro Standard F.S Co\Desktop\SF grasscut\oscar\aaaaa\Debug\aaaaa.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Users\Pro Standard F.S Co\Desktop\SF grasscut\oscar\aaaaa\aaaaa\Debug\BuildLog.htm"
aaaaa - 2 error(s), 0 warning(s)
and lets say that I dont want the user to enter the radius not more than 5 cm. if they enter radius value above above 5 , the system gives the messege " your value is not in our range"
@ bazzy Thanks alot
Can you tell me what is wrong with this program
#include <iostream>
using namespace std;
#define PI 3.14159
int main ()
{
double r; // radius
double area;
cout <<"enter the radius value";
cin >>r;
area = PI * r*r;
cout << circle;
return 0;
}
this program is giving this errror
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\Users\Pro Standard F.S Co\Desktop\SF grasscut\oscar\aaaaa\Debug\aaaaa.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Users\Pro Standard F.S Co\Desktop\SF grasscut\oscar\aaaaa\aaaaa\Debug\BuildLog.htm"
aaaaa - 2 error(s), 0 warning(s)