Main Menu

HOME

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

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   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
Get your IP address(VBNet)
Usable Screen percentage(Javascript)
Find all links(PHP)
Wired news(PHP)
Read part of a file(ASP)
Change wallpaper(VB)
Latest stock market information(PHP)
open default browser with a url(VB)

    




Copyright © 2003 by programmershelp.co.uk