Find errors
(1) m = ++a*5;
(2) a = b ++ -c*2;
(3)y = sqrt (1000);

Answers were Sorted based on User's Feedback



Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);..

Answer / sumalatha

b is the error because decrement of c is instead of --c it has -c

Is This Answer Correct ?    6 Yes 2 No

Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);..

Answer / anand

1. compiler gives syntax error there should be any space
between increment or decrement operators and the variable.

2. even if some compilers accept this, then b++ - c*2 is
considered where c*2 is subtracted from the present value of
variable b and after that the value in variable b is
decremented by 1.

Is This Answer Correct ?    5 Yes 1 No

Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);..

Answer / renu

m will be error because the increment should be done before
the assignment symbol.

Is This Answer Correct ?    1 Yes 0 No

Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);..

Answer / srikanth karnati

(2)HAS ERROR

Is This Answer Correct ?    1 Yes 0 No

Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);..

Answer / pranav

2) has an error because the LVALUE (b++) is not yet
incremented before evaluation

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

Linked lists -- can you tell me how to check whether a linked list is circular?

0 Answers  


what is computer engg

1 Answers  


How many types of linked lists what are they? How many types of data structures?

18 Answers   BSNL, Pivotal Software,


What is the difference between the expression “++a” and “a++”?

0 Answers  


What is a list in c?

0 Answers  






How can I automatically locate a programs configuration files in the same directory as the executable?

0 Answers  


What is a void pointer? When is a void pointer used?

0 Answers   Aspire, Infogain,


Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?

1 Answers  


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

0 Answers   Wilco,


Why is main function so important?

0 Answers  


suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan

1 Answers  


What does node * mean?

0 Answers  


Categories