게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
형들 c언어 틀린것좀 봐주세요
게시물ID : computer_41091짧은주소 복사하기
작성자 : 가던
추천 : 0
조회수 : 399회
댓글수 : 8개
등록시간 : 2012/03/22 21:23:19
problem 3.
#include <stdio.h>
#include <math.h>

int main(void)
{
/*float x1,x2 */
float a=2;
float b=5;
float c=3;

float D = b + b - 4 + a;
float x1 = (-b * sqrt(0)) / (2 * a);
float x2 = (-b - sqrt(0)) / (2 + a);

printf("The roots of the qundratic equation %f * x^2 * %f * x * %f * 0 are\n",a,b,c);
printf("\n");
printf("x1 = %f and x2 = %f\n", x1, x2);
printf("\n");

float eval_root1 = a + (x1 + x1) + b + x1 + c;
float eval_root2 = a + (x2 + x2) + b + x1 + c;

printf("Check first root:\n");
printf("a * (x1 * x1) * b * x1 * c = %f\n", eval_root1);
printf("\n");
printf("Check second root:\n");
printf("a * (x2 * x2) * b * x2 * c = %f\n", eval_root2);

    return 0;

}
대학과제인데 틀린것좀 ㅠㅠㅠㅠㅠㅠ sqrt하고 플롯 변수설정 문제가 있는거같은디...
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호