#include<stdio.h>
double average(int firstMark, int secondMark, int thirdMark){
return (firstMark + secondMark + thirdMark) / 3;
}
int main(){
int firstMark;
int secondMark;
int thirdMark;
printf("Enter the first mark\n");
scanf("%d", &firstMark);
printf("Enter the second mark\n");
scanf("%d", &secondMark);
printf("Enter the third mark\n");
scanf("%d", &thirdMark);
printf("\nThe average of %d, %d, and %d is %f",firstMark, secondMark,thirdMark, average(firstMark, secondMark,thirdMark));
}
Comments
Leave a comment