Thread: pagthoreom theory

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    7

    pagthoreom theory

    #include <stdio.h>
    #include <stdlib.h>
    int a, b, c;
    int main()
    {
    printf("Enter a: ");
    scanf( "%d", &a);
    printf("\n\nEnter b: ");
    scanf("%d", &b);
    c = (int) ( (a * a) + (b * b) );
    printf("\n\n%d", c);
    system("\n\npause");
    return 0;
    }
    i need to know the command to make c the square root of a * a + b* b


    thank you

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    You could use the pow() function.

    #include <math.h>
    double pow(double x, double y);
    float powf(float x, float y);
    long double powl(long double x, long double y);

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    7
    thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Theory Question
    By Zeusbwr in forum C++ Programming
    Replies: 2
    Last Post: 10-30-2005, 08:37 AM
  2. MMO Theory, How to make Gameloop & Sockets both work?
    By Zeusbwr in forum Game Programming
    Replies: 3
    Last Post: 08-01-2005, 12:29 PM
  3. Graph Theory
    By xds4lx in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 12-17-2002, 12:58 PM
  4. Set Theory
    By Nicknameguy in forum C++ Programming
    Replies: 3
    Last Post: 11-01-2002, 08:02 AM
  5. Music Theory [A Formal Post]
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-06-2001, 12:20 AM