I have written the code:
#include <stdio.h>
int main() {
float avg = 8/3;
printf("Average: %.1f", avg);
return 0;
}
When I run the program, the output is:
Average: 2.0
the output I want is the avg var will be 2.6.
I understood from google this should be the output, but it's not. What am I doing wrong?