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
C program for function  of average int average(int); void main() {           int max=0,c=0;           clrscr();           printf("ENTER THE LIMIT OF INPUT FOR AV

You are required to write a stand-alone DSP application in the C programming language. The overall objective of this application is to convert a signal from the time domain to t

Create a program WordCount1Main.java doing the following:  For each word in the le word.txt { Create an object of the class Word { Add the object to a set of the type java.uti

program for compiler design in c



Write a program to define a matrix: 1. Write a function that takes an integer and calculates and returns the factorial of the integer. The Factorial of a number "n" is compute

Study the following  class diagram, additional information  and answer  the  questions that follow: MovieTicket movieName: string TicketPrice: doub

Prepare an Application in C# or C++ Project Description: We are seeking someone who can write a program in C# or C++. The idea is to prepare the program using a Cross Plat