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
Write a ‘C’ program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

a padovan string p(n) for a natural number n is defined as p(0)=''x'' p(1)=''y'' p(2)=''z'' p(n)=p(n-2)+p(n-3),n>2

C program to demonstrate Pointer to variable: void p2a(int *); void main() {                 int x=10, *a,**b;                 int arr[5];                 //poin

there is a pebble merchant. he sells the pebbles,that are used for shining the floor.his main duty is to take the length of the room side but he sometines mistakes doing that and m

i wont to make triangle with number but number from the largest possible number to 01 (reversed).

write a c++ program which finds minimum of three numbers

how many bytes required to char

Using the Constructor There are basically three ways of creating and initializing the object. The first way to call the constructor is explicitly as :

A: The answer to this lies actually, how they used. Along ++i(PreIncrement) the variable is incremented and new value is returned. Thus it needs one instruction to increment the va

a palindrome is a string that reads the same from bhote the ends