Your trouble is with this line:
Code:
double nota=(punctaj / nr_intrebari)*10;
Because punctaj and nr_intrebari are int's, then 1/3 = 0 -> you're doing integer division. Integer division discards the remainder. 1/3 = 0.333... so the integer answer is 0. 6/5 = 1.2 so the integer answer is 1.
If you want the result as a double, you have to cast.
Try this:
Code:
double nota=(punctaj / (double)nr_intrebari)*10;
The (double) tells the compiler that you want to evaluate the integer division as if it were floating point division.