I have done the assignment almost but the problem is that in assignment average value is 23 but according my program it's avg is 22 because 22.4 is the average if we calculate on the calculator so 0.4 will be truncated and the answer will be 22. My answer is as follows in attachment........................
Second problem is that instead of 1st,2nd,3rd....my answer is like this 1 ,2,3 .....
If you have better idea please share and you can also add me on my skype id
actually when average is calculated its value is float but when u assign to int variable it lost the decimal fraction so need to cast value in double and use math library function as
int average=ceil(double(sum/limit)); this statement out 23
i hope u get 23 now :P
I got the point but its not working yet. It's giving the same result.
u r right . but round off 22.4 must b 22 not 23 , that is a big mistake.
have you done the assignment???
bro average key liay variable float use karo
can someone kindly tell me...whenever i run my program the output window is disappear
Assalam o Alaikum!
for printing 1st, 2nd, 3rd,4th you need to use if-else if statements, first you need to write
if main i "st"
else if main i"nd"
else if main i"rd"
sirf else i"th"
kyun kie baqi sab main th hi use hoga
All of you are requested, Please post Only One Discussion for Current Assignment/GDB/Online Quiz and everyone reply/share/discussed his/her data on that same discussion, so that all members get solution & discuss easily on Current Assignment/GDB/Online Quiz.
So please don’t post two or more discussions for one Current Assignment/GDB/Online Quiz, hope you’ll understand and cooperate with us.
Already started discussion for same assignment link
thanks for understanding
Salam Guys check my assignment and tell me if there is any problem..its attached below...