Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[750] Re:틀린곳이 없는데 에러를 보이네요......
남병철.레조 [lezo] 1697 읽음    2002-06-14 07:31

안녕하세요? 레조입니다.
함수를 사용하실때 인수를 넣는 부분에서 잘못되었었네요.



#include <stdio.h>

float div(int a, int b);   /*prototype of division fuction*/
float mod(int a, int b); /*prototype of surplus fuction*/

void main(void)
{
    int a, b;
    float div_value, modulus;
    a = 10;
    b = 5;

   div_value = div( a, b );
   modulus = mod( a, b );
   printf("%d 을 %d 로 나눈 값은 %f 이고 나머지는 %f 이다", a, b, div_value, modulus);
}

float div(int a, int b)   /*calculate division*/
{
    return(a/b);
}
float mod(int a, int b)    /*calculate modulus*/
{
    return(a%b);
}



씨_java 님이 쓰신 글 :
: /*fuction을 이용한 나눈값과 나머지 구하기*/
:
: #include <stdio.h>
:
: float div(int a, int b);  /*prototype of division fuction*/
: float mod(int a, int b); /*prototype of surplus fuction*/
:
: void main(void)
: {
:     int a, b;
:     float div_value, modulus;
:     a = 10;
:     b = 5;
:
:    div_value = div(int a, int b);
:    modulus = mod(int a, int b);
:    printf("%d 을 %d 로 나눈 값은 %f 이고 나머지는 %f 이다", a, b, div_value, modulus);
: }
:
: float div(int a, int b)  /*calculate division*/
: {
:     return(a/b);
: }
: float mod(int a, int b)   /*calculate modulus*/
: {
:     return(a%b);
: }
:
: 어디가 틀렸는지 모르겠습니다...부탁드리겠습니다.....

+ -

관련 글 리스트
749 틀린곳이 없는데 에러를 보이네요...... 씨_java 1675 2002/06/14
750     Re:틀린곳이 없는데 에러를 보이네요...... 남병철.레조 1697 2002/06/14
755         Re:Re:틀린곳이 없는데 에러를 보이네요...... ¾¾_java 1702 2002/06/15
759             Re:Re:Re:틀린곳이 없는데 에러를 보이네요...... 남병철.레조 1748 2002/06/15
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.