C program to calculate area of cube, C/C++ Programming

Aim: To implement program to calculate area of cube using inline function.

Code:

inline void area_cube(float side)

{

            float area;

            area=6*side*side;

            cout<<"\nArea of cube with side "<

}

void main()

{

            int side;

            clrscr();

            cout<<"Program to calculate area of Cube:";

            cout<<"\n Enter side of cube:";

            cin>>side;

            area_cube(side);

            getch();

}

 

Output:

Program to calculate area of Cube:

 Enter side of cube:7

Area of cube with side 7 cm is 294 cm²

Posted Date: 9/29/2012 3:55:17 AM | Location : United States







Related Discussions:- C program to calculate area of cube, Assignment Help, Ask Question on C program to calculate area of cube, Get Answer, Expert's Help, C program to calculate area of cube Discussions

Write discussion on C program to calculate area of cube
Your posts are moderated
Related Questions
Define External Storage Class - computer programming? When a variable is declared outside a function the storage is permanently assigned to it and its storage class is 'extern'

Write an algorithm for multiplication of two sparse matrices using Linked Lists.

for object, malloc allocates memory in heap however doesn't invoke object's constructor to initialize the object. new allocates memory & also invokes constructor to initialize the

I need website Product section search box coding section fix Project Description: On our products section in the search box it only searches the name and title of our product

Inline Functions Imagine a c program, which reads disk records having employee information. If this is a payroll application each employee record data is probably processed by

Question: (a) Describe what are dynamic pointers. Show their memory representations diagrammatically. (b) Write short notes about pointers in arrays, paying attention on

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Problem : (a) Stacks can be implemented using arrays. Write down the following C or C++ function to (i) create a stack (ii) add an element to a stack (push). (b) Expl

Create a .cpp program that verifies the strength of a password that a user is entering is strong (complex/secure) enough. In the main area of the program, prompt the user to enter

C Program for RADIUS OF CIRCLE   #define PI 3.14159 main() {           float r,a;           clrscr();           printf("ENTER THE RADIUS OF A CIRCLE: ");