C언어 결과값 0만 나오네요

조회수 408회

포물선 운동 구하는 공식 이용했는데 문제가 없는거 같은데 결과값은 0밖에 안나오네요 혹시 뭐가 문제일까요

%%file task6.c

#include <stdio.h>
#include <math.h>

int main(void) {
    double t, V0, d, g;
    double Vx, x, Vy, y;

    g = 9.8;
    Vx = (V0*cos(d*M_PI/180));
    x = ((V0*cos(d*M_PI/180))*t);
    Vy = (V0*sin(d*M_PI/180) - g*t);
    y = ((V0*sin(d*M_PI/180))*t - 1/2*g*t*t);

    printf("Enter the first speed.(m/s)");
    scanf("%lf", &V0);
    printf("Enter the angle.(°)");
    scanf("%lf", &d);
    printf("Enter the time.(s)");
    scanf("%lf", &t);

    printf("Vx = %lf\n", Vx);
    printf("x = %lf\n", x);
    printf("Vy = %lf\n", Vy);
    printf("y = %lf\n", y);

    return 0;
}

1 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)