#include
#include
#include
using std::cout;
using std::cin;
using std::endl;
using std::setw();
int main()
{
const double PI = 3.14153;
double radius = 0.0;
cout << "Enter radius of circle: ";
cin >> radius;
unsigned short precision = 5;
cout << endl <<"Enter precision you want have (not more than 6 digits): ";;
cin >> precision;
cout << setw(precision) <
system("PAUSE");
return 0;
}
Chat with our AI personalities
#include<stdio.h>
main()
{
float r,area;
printf("Enter radius\n");
scanf("%f",&r);
area=3.14*r*r;
printf("area=%f",area);
}
write a note on event driven programming
write a program draw circle and ellipse by using oval methods in java
To use an analogy, a programming language is similar to any natural language such as English. We use the language to construct expressions which can be combined to form statements, just as we use English to construct expressions which can be combined to form sentences. Programming tools are simply tools that help us to write code, in much the same way that word processors help us to write letters. In programming, the main tools we use are code editors, compilers and debuggers. But just as a spell-checker won't help us write better poetry, programming tools won't help us write better programs. For that we must understand the language itself.
Most modern programming languages have some support for object-oriented programming. In some (such as Java), it is obligatory - you have to write your code in classes. In others - such as JavaScript or PHP - it is optional, meaning that you can write programs the old-fashioned way (procedural programming).
Statements.