Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (anonymous):

Write a program to calculate CGPA of a student. The program should be able to get input from the user of the Mark for each course. Please see the Attached File

OpenStudy (anonymous):

OpenStudy (anonymous):

.. i don't know c(?) syntax put some printf statements in there to see what is happening

OpenStudy (redprince):

Actually, You Are Not Using The Conditions In The if Statement...!! It Should Be Like This: if (a >= 90 && a <= 100) { e = 4; } else if ( a >= 80 && a <= 89) { e = 3; } and so on...!! Actually, When You Use This: if (90 <= a <=100) { a = 4; } So, When You Enter 66 Then 90 Is Compared With The Value Of a i.e., 90 <= 60 Is False, But 100 Is Compared With What Value...!! If You Think That (90 <= a >=100) Means That a Is Less Then Or Equal To 90 And a Is Greater Then Or Equal To 100, Then This Is True When You Are Write These Kind Of Expressions In Mathematics, But In C As Long As I Know, This Is Not A Replacement Of This Statement...!! The Correct Replacement Of (90 <= a >=100) Is (a >= 90 && a <= 100) In C...!! I Hope This Will Help You...!!

OpenStudy (anonymous):

its now ok, thak you

OpenStudy (anonymous):

Thank You very much

OpenStudy (redprince):

You Are Welcome....!!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!