Find errors
(1) m = ++a*5;
(2) a = b ++ -c*2;
(3)y = sqrt (1000);
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / renu
m will be error because the increment should be done before
the assignment symbol.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / pranav
2) has an error because the LVALUE (b++) is not yet
incremented before evaluation
Is This Answer Correct ? | 1 Yes | 0 No |
Linked lists -- can you tell me how to check whether a linked list is circular?
what is computer engg
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++”?
What is a list in c?
How can I automatically locate a programs configuration files in the same directory as the executable?
What is a void pointer? When is a void pointer used?
Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?
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); }
Why is main function so important?
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
What does node * mean?