Function should return value <<<มันErrorอย่างนี้อะคับ ช่วยตรวจทีคับ
#include<stdio.h> #include<conio.h> main() { clrscr(); char ans; float sum = 0.0 , expenses , mean = 0.0 ; int n = 1; const char line [40] =" "; printf("\n \n"); printf("* Caculate MEAN Expenses * \n"); printf("%s \n" , line); do {
printf("\n\n Expenses Course %d =" , n) ; scanf("%f" , &expenses); sum = sum + expenses ; n = n + 1; printf("\n\n ** caculate agaib y/n =>"); ans = getche(); } while (ans != 'n'); mean = sum / (n-1); printf("\n %s \n" , line ); printf("\n * Sum Expenses Course = %.2f", sum); printf("\n * Number Course = %d" , n-1); printf("\n * Mean Expenses Course = %.2f", mean); printf("\n\n %s \n", line); }
|