C++에서 제곱을 하는 방법

Develop My Life·2022년 2월 18일
0

PS

목록 보기
6/32

C++에서 제곱을 하는 방법

#include <cmath>

int main(){
	int test = pow(10, 2) //test = 100

	return 0;
}
  • cmath를 include 해주고 pow 함수를 사용하면 된다.

  • pow(밑, 지수)로 사용할 수 있다.

0개의 댓글