php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
write a function to calcute the power of some number, will we only save it or we will
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
respected sir,

when we write a function to calcute the power of some number, will we only save it or we will cobpile

and run it?plz clearify it,im so much cnfused.when we write d program to call the function, what will we do? whether we compile it or not?plz help me.i write the function as below.is it correct?what wil i do with dis?

will i cmpile it? plz guide me

//function to calculate the power of some number
double raiseToPow(double x,int power)
{
double result;
int i;
result=1.0;

for(i=1;i<=power;i++)
{
result *= x; //same as result = result * x
}
return(result);
}
Reply
#2
when we write a function to calcute the power of some number, will we only save it or we will cobpile

and run it?plz clearify it,im so much cnfused.when we write d program to call the function, what will we do? whether we compile it or not?plz help me.i write the function as below.is it correct?what wil i do with dis?

will i cmpile it? plz guide me

//function to calculate the power of some number
double raiseToPow(double x,int power)
{
double result;
int i;
result=1.0;

for(i=1;i<=power;i++)
{
result *= x; //same as result = result * x
}
return(result);
}
Reply
#3
Dear student!
Function is part of a program. Individually you can not execute that function. Your function is correct. But you need to write complete program that will include this function. That program will be compiled and executed.
Program containing function to calculate power of number is given in lecture 9. Please consult lecture 9. Try sample programs given in the lecture. Your concept will be clarified.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  why we use inline function if there are simple function available, or what is the spa Vuhelper 0 22,070 05-31-2012, 01:51 AM
Last Post: Vuhelper
  Default Function Argument with example Vuhelper 0 13,436 05-31-2012, 01:47 AM
Last Post: Vuhelper
  What is the difference among calloc function ,malloc function and recalloc function? Vuhelper 0 34,694 05-31-2012, 01:46 AM
Last Post: Vuhelper
  What is Function Overloading in C++ Vuhelper 0 5,502 05-31-2012, 01:45 AM
Last Post: Vuhelper
  offline function in C++ Vuhelper 0 3,740 05-31-2012, 01:42 AM
Last Post: Vuhelper
  i take input from getchar(); function in program in C++ 2012 Vuhelper 0 3,114 05-31-2012, 01:40 AM
Last Post: Vuhelper
  how we used the 1-calloc Function 2- malloc Function 3- free () 4- realloc Function i Vuhelper 1 31,268 05-31-2012, 01:35 AM
Last Post: Vuhelper
  What are the function of IO ports in C++ Vuhelper 0 3,703 05-31-2012, 01:27 AM
Last Post: Vuhelper
  Argc(argument count) and argv(argument value) are used in main function Vuhelper 0 2,115 01-04-2012, 10:42 PM
Last Post: Vuhelper
  Why we write main rgc,char**argv in C++ 2012 Vuhelper 0 3,106 01-04-2012, 10:36 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support