Notice
Recent Posts
Recent Comments
Creative Code
average.c(평균구하기) 본문
#include <stdio.h>
int main(void)
{
int korean;
int math;
int english;
printf("국어 점수 : ");
scanf("%d",&korean); // 국어 점수를 입력받을 때
printf("수학 점수 : ");
scanf("%d",&math); // 수학 점수를 입력받을 때
printf("영어 점수 : ");
scanf("%d",&english); // 영어 점수를 입력받을 때
double average = (korean + math + english)/3.0;
printf("평균 점수 : %.1f\n",average);
return 0;
}
'C Programming' 카테고리의 다른 글
fahr2celsius2.c(화씨를 섭씨로 바꾸기) (0) | 2023.07.31 |
---|---|
fahr2celsius.c(화씨를 섭씨로 바꾸기) (1) | 2023.07.31 |
circle.c(원의 넓이 구하기) (0) | 2023.07.31 |
celsius2fahr_1.c(섭씨를 화씨로 바꾸기) (0) | 2023.07.31 |
celsius2fahr.c(섭씨를 화씨로 바꾸기) (0) | 2023.07.31 |