Could anybody tell me what's wrong with this problem. I'am an absolute beginner so don't assume anything? It's saying in the compiller that it cannot convert char to double...
/* Halving 'n'*/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main ()
{
double n, r;
char szInput [256];
printf("Enter the value of n: ");
gets(szInput);
n = atof(szInput);
r = szInput/2.0;
printf("Half of n is %d\n", r);
return 0;
}