나머지 구하기

김토리·2024년 2월 5일

알고리즘

목록 보기
1/27
post-thumbnail

오랜만에 코딩 테스트 준비를 시작하기 때문에 정답률 높은 순 부터 시작하기로 한다 . . .

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>

int solution(int num1, int num2) {
    return num1 % num2 ;
}

나머지 구하기 문제는
% 연산자가 나머지 값을 구하는 연산자이기 때문에
return 으로 뱉어주면 된다.

profile
웹 개발하며 데이터 분석, AI 공부하는 jinveloper

0개의 댓글