www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Assignment # 1 CS201

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

shahid.khalil123

Views: 2050

Attachments:

Replies to This Discussion

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

Dear Fellows,

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.

http://vustudents.ning.com/group/cs201introductiontoprogramming/for...

thanks for understanding

Salam Guys check my assignment and tell me if there is any problem..its attached below...

Attachments:

current

Top Trends

1

2

3

4

Mani Siddiqui

5

------------------------------------

Latest Activity

33 minutes ago
Asadullah joined + M.Tariq Malik's group

MTH100 General Mathematics

33 minutes ago
36 minutes ago
aisha, zaniab, Iqra Mubashir and 2 more joined Virtual University of Pakistan
2 hours ago
Dream♥Girl joined + M.Tariq Malik's group

CS606 Compiler Construction

8 hours ago
8 hours ago
Asad waqas added a discussion to the group PSY101 Introduction to Psychology

11 hours ago
12 hours ago