answersLogoWhite

0


Best Answer

#include

using std::cin;
using std::cout;
using std::endl;

double cube(double number);//prototype

int main()
{
double number = 0.0;

cout << endl << "Enter a number: ";
cin >> number;

cout << endl << "Cube of " << number << " is " << cube(number) << endl;

system("PAUSE");
return 0;
}

double cube(double number)
{
return (number * number * number);

}

Also you can use the function pow(x, y) which returns x to the power of y (you have have include math.h).

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to enter a number and print its cube?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write program that read an integer and display all its smallest factors?

All the smallest factors of a number must be its smallest factor, which for any number is 1, so: loop loop loop print "Enter an integer number: ": input n until num(n) do print "Please enter a number" repeat until n = int(n) do print "Please enter an integer" repeat print "Smallest factor of ":n:" is 1" repeat


Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write the program in qbasic and add two numbers?

Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end


Write a program to accept any number n print the qube of all the number from 1 to n that are divisible by 3?

# Ruby code print 'Enter n: '; n = gets.to_i n.times { | i | puts ( i + 1 ) ** 2 if ( i + 1 ) % 3.0 == 0.0 }


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


Write a unix program to print print a pattern?

echo 'print a pattern'


You want to write a simple without using pointer or array c program which will print greatest number when you give 20 number?

i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


Write a program to print whether the letter is vowel or not in BASIC?

vowels$ = "aeiou" CLS PRINT "PROGRAM: Find if letter is a vowel or not" PRINT INPUT "Type a single alphabet letter: (a-z)/and, then, press Enter key"; aLetter$ PRINT PRINT "Letter "; aLetter$; IF INSTR(vowels$, LCASE$(aLetter$)) THEN PRINT " is a vowel." ELSE PRINT " is NOT a vowel." END


Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


How do you write a program to enter your name in c using?

/*to print your namr*/ /*by girish kumar raghuvanshi*/ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { printf("print ur name"); puts("girish"); getch(); }