answersLogoWhite

0

#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

16y ago

What else can I help you with?

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 a program to input two numbers and print their number and square?

Here's a simple Python program that takes two numbers as input and prints each number alongside its square: # Input two numbers num1 = float(input(&quot;Enter the first number: &quot;)) num2 = float(input(&quot;Enter the second number: &quot;)) # Print each number and its square print(f&quot;Number: {num1}, Square: {num1**2}&quot;) print(f&quot;Number: {num2}, Square: {num2**2}&quot;) This program uses the input function to read numbers, converts them to floats, and then calculates and displays their squares.


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 an assembly language program to print a to z on screen?

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


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


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?


Write a unix program to print print a pattern?

echo 'print a pattern'


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


How do you write a program in qbasic to input 64751315 to sum?

In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT &quot;Enter a number: &quot;; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT &quot;The sum of the digits is &quot;; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.


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 ?