Can anyone tell me how to calculate average in a C++ program for e.g average of numbers?
I have used the following code:
Average=0
Average+=Marks_Eng+Marks_Hin+Marks_Math+Marks_Sci%4;
This does not give me correct output.
Last edited on
Last edited on
done that...does not work...
Also keep in mind the order of operations. Division (or modulo) happens before addition. You need to group the items being averaged.
Average = ( num1 + num2 + ... numn ) / n
thanks jdd...it worked:-)...i will keep this in mind...