Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Cube Function
 

 

Description

Shows a simple function in C which takes a number , cubes it and the returns the result .

Code

#include <stdio.h>

long cubed(long x);
long input,result;

main()
{

printf("Please enter an integer value.\n");
scanf("%d",&input);
result = cubed(input);
printf("The cube of %ld is %ld .\n",input ,result);
return 0;
}

long cubed(long x)
{
long xcubed;
xcubed = x * x * x;

return xcubed;
}

Information

tested using Visual C++ 6 , LCC win 32

 

 
 

 

Download

cubefunction.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
display information about a file(VB)
Multicolored text(Javascript)
decimal to binary conversion(PHP)
DatePart function example(VBScript)
Odd or Even(ASP)
Detect if media in drive(VB)
launch notepad using process(VB.net)
Insert text into a file(ASP)

    




Copyright © 2003 by programmershelp.co.uk