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

Point out the errors, if any, in the following C statements: (a) int = 314.562 * 150 ; (b) name = ‘Ajay’ ; (c) varchar = ‘3’ ; (d) 3.14 * r * r * h = vol_of_cyl ; (e) k = ( a * b ) ( c + ( 2.5a + b ) ( d + e ) ; (f) m_inst = rate of interest * amount in rs ;

OpenStudy (anonymous):

I've only programmed in C++ but the answers should be the same (a) int = 314.562 * 150 ; int is a reserved word, you can't assign it a value. and if it does allow you to do that, then your assigning a double value to an int variable. (b) name = ‘Ajay’ ; if name is a string, you need " Ajay " (c) varchar = ‘3’ ; this should be okay. not sure (d) 3.14 * r * r * h = vol_of_cyl ; this is backwards. vol_of_cyl should be in front of the = (e) k = ( a * b ) ( c + ( 2.5a + b ) ( d + e ) ; your missing a parenthesis (f) m_inst = rate of interest * amount in rs ; rate of interest and amount in rs have spaces. can't have spaces in variable / function names

OpenStudy (anonymous):

Thanks Its correct ! I knew the answer i just wanted to b sure so now i am sure !

OpenStudy (anonymous):

kk, no problem :)

OpenStudy (anonymous):

just an addition...e is wrong coz there are no operators between the parenthesis not because of missing par...

OpenStudy (anonymous):

ok missing para...... too

OpenStudy (anonymous):

doesn't it automatically multiply it? because of parenthesis i mean.

OpenStudy (anonymous):

nope c compilers are not that smart :)

OpenStudy (anonymous):

ah, i guess they added that in other languages then :)

OpenStudy (e.mccormick):

(c) varchar is also a data type: http://publib.boulder.ibm.com/infocenter/idshelp/v111/topic/com.ibm.esqlc.doc/sii04981134.htm

OpenStudy (e.mccormick):

So it is a reserved word.

OpenStudy (e.mccormick):

And remember to close questions when done with them. =)

OpenStudy (anonymous):

^ and ask new questions as new questions and not in the same thread.

OpenStudy (anonymous):

Write a program in C language to implement three equation of motion for user define input.Can anyone help me in that

OpenStudy (anonymous):

I also need help in a project ,i am suppose to make a little bit of a big program like a game or a calculator

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!