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
random ellipses(Darkbasic)
Status bar text mouseover(Javascript)
checks whether a file exists(VB)
transparent form(VB)
mouse position(VB)
delete a folder(VB.net)
celsius to fahrenheit conversion(C Sharp)
Tables supported(ASP.net)

    




Copyright © 2003 by programmershelp.co.uk