Notice
Recent Posts
Recent Comments
Creative Code
procScore.c (배열 성적평균구하기) 본문
#include <stdio.h>
int main(void)
{
int scores[5];
for (int i = 0; i<5; i++) {
scanf("%d",&scores[i]);
}
int total = 0;
for (int i =0; i<5; i++) {
total += scores[i];
}
double average = (double)total/5.0;
printf("total : %d\t average : %.2f\n",total,average);
return 0;
}
'C Programming' 카테고리의 다른 글
multiplyTable.c (구구단) (0) | 2023.08.01 |
---|---|
absoluteValue2.c (절댓값 구하기-삼항연산자) (0) | 2023.08.01 |
oddEven.c (홀수,짝수 판별) (0) | 2023.07.31 |
maxMidMin.c (최대,중간,최소값 구하기) (0) | 2023.07.31 |
letterAttribute.c (비트연산) (1) | 2023.07.31 |