WHat will this code produce?

#include
#include

void main()
{
int i = 25, j = 2, k = 5;
printf("%.2f
", sqrt(i));
printf("%.2f
", pow(j,k));

}



it aint working for me

Comments

  • Well, if you change the code around a bit:
    #include
    #include

    int main() /* If you compiled with a C++ compiler you must change main()'s return type to 'int'. */
    {
    int i = 25, j = 2, k = 5;
    printf("%.2f
    ", sqrt(i));
    printf("%.2f
    ", pow(j,k));

    /* Get some input, so the program stays running long enough to read the output. */
    int extra;
    scanf("32%s", extra);
    }

    ...You get this for output:
    5.00
    32.00


  • : #include
    : #include
    :
    : void main()
    : {
    : int i = 25, j = 2, k = 5;
    : printf("%.2f
    ", sqrt(i));
    : printf("%.2f
    ", pow(j,k));
    :
    : }
    :
    :
    :
    : it aint working for me

    the code is clearly fine and obviously produce some valid output as i expected. why dont u check with a compiler rather than asking us? what is ur expectation from the code? be more specific.
  • : how?
    :
    you been watching some old John Wayne westerns? How what???

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories