C \ C++/22_1 기컴프 (C)

[C언어 실습/기컴프 과제] 4.12

안정민 2022. 6. 21. 21:07

프로그래밍연습 4.12

scanf문을 사용하여 세개의 값을 읽고 다음 결과들을 출력하는 프로그램을 작성 하시오.

 

(a) 세 값의 합

 

-

#include <stdio.h>


main()
{
    float a, b, c, sum;

    printf("Enter three number: ");
    scanf_s("%f %f %f", &a, &b, &c);

    sum = a + b + c;
    printf("%f", sum);
}

 

-