I want to create an arithmetic mean program. For e.g. n=6, (1+2+3+6)/4=3. n is the number which is given by the user. b is calculating the numbers, if n%a=0 (in the example 1,2,3,6). d is calculating the numbers (in the example the 4). In the end x=b/d and we will have the answer. But when I enter the n in the scanf, the program crashes. What is the problem? Sorry for the bad english, if it is bad.
int main(int argc, char *argv)