Sponsored Links


Results 1 to 3 of 3

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

  1. #1
    sana.pari
    Guest

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

    Sponsored Links1


    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

    Sponsored Links

    //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);
    }

  2. #2
    sana.pari
    Guest
    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);
    }

  3. #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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 05-31-2012, 01:35 AM
  2. Write an easy on Knowledge Is Power
    By vustudents in forum Bise
    Replies: 0
    Last Post: 06-17-2011, 01:22 AM
  3. Replies: 1
    Last Post: 05-12-2011, 10:02 PM
  4. Replies: 1
    Last Post: 04-24-2011, 05:35 PM
  5. Write an essay on the power of public opinion 11-03-2011
    By vustudents in forum Announcements
    Replies: 0
    Last Post: 03-11-2011, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft | Jobs