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
programme for time table in c++

how to find the volume of cone , cylinder and sphere ?

Want an EA project for Jack Bsher Project Description: New EA game Skills required   Android, C++ Programming, PHP, Metatrader, SQL

What do you mean by a sequential access file? - When writing programs which store and retrieve data in a file, it's possible to designate that file into various forms. - A s

Node *orderedInsert(Node *p, int newval); /* Allocates a new Node with data value newval and inserts into the ordered list with first node pointer p in such a way that the data va

Spider webs have two types of silk, sticky silk and strength silk, spiders do not move on the sticky silken threads only on the strength threads. Assume one type of spider creates

wap to print padovan string in c

A: This will turn o_ "name mangling" for func so that one can connect to code compiled by a C compiler.

C Program to Check  EVEN & ODD NO   main() {           int n, a;           clrscr();           printf("ENTER ANY NUMBER: ");           scanf("%d", &n);