The ultimate destination for quality online tuitions, assignment and homework help

+1 (718) 3957640
+1 (718) 3957640

Gtalk/MSN/Yahoo! ID: assignment.maker

HwA Blog

C++ Programming Help – To enter an integer and output the cube of that integer

Jan 31 2011

C++ is one of the most popular languages ever created. Its application domains include system software, application software, device drivers, embedded software, high performance server and client applications and entertainment software such as video games. C++ is also used in hardware design. The standard version of C++ is ISO//IEC 14882:2003.

Here is an example of a Program to enter an integer and output the cube of that integer

#include

#include

int cube(int x); //The prototype.

void main()

{

clrscr();

int a;

cout << “Enter an integer : “;

cin>>a;

cout << “The cube of ” << a << ” is : ” << cube(a) << endl; //Call the function cube(a).

getch();

}

//Defining the function.

int cube(int x)

{

int y;

y=x*x*x;

return(y);

}

Here a function called the cube of a number is being created and that function defined and is stored in a variable called int y. Where, y = x*x*x which x3.

When we run the function by entering a number the output, i.e., the cube of that particular number is generated.

For any C++ Assignment help, Homework help and Online Tutoring you can visit our website at http://www.helpwithassignment.com/programing-assignment-help. Our C++ experts will guide you through your needs at a very minimal price.

There are no comments yet, add one below.

Leave a Reply

Your Name: (required)
Your Email(will not be published): (required)
Website: (not required)
Message: (required)

Assignment Request

Name :
Email :
Phone :
Upload H/W File:
Instruction:
Due Date:
Hours:

Free Download

Bookmark and Share
Copyright © 2014 HelpWithAssignment.com. All rights reserved.
Assignment Help, Accounting Assignment Help, Statistics Assignment Help, MBA Assignment Help, Assignment Writing Service
Associate Website: http://www.helpwiththesis.com