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 |
main() { int i,n=010; int sum=0; for(i=1;i<=n;i++) {s=s+i; } printf("%d",&s); getch(); }
What is data structure in c programming?
Explain Linker and Loader
what is the structure?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
write a programming in c language, 1 3 5 7 9 11
How to add two numbers with using function?
What is bash c?
What does static variable mean in c?
Explain what are its uses in c programming?
Define a structure to store roll no, name and marks of a student. Using the structure of above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.
You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less.