int a=0,b=2;
if (a=0)
b=0;
else
b=*10;
What is the value of b ?
Answers were Sorted based on User's Feedback
Answer / kc
The code will not compile as statement "b=*10" is invalid"
It should be "b*=10".
If i assume "b*=10" then the output will be 20
Reason:
a=0;
b=2;
if(a=0 means 0) so b=0 will not execute
b=b*10=2=10=20;
| Is This Answer Correct ? | 37 Yes | 6 No |
Answer / akash
The value of b will be 20.
Because when a=0 is presented in if condition, it will take it as false condition. So the else block will execute.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kishore sharma
a=0;
b=2;
but
condition
if(a=0)(b=0)
so
b=*10;
answer is
b=b*10 (b=0)
b=0*10;
0
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sandeep kumar
if (a=0)
is a wrong statement.
Since it should be
if (a==0)
so, it will throw an error
| Is This Answer Correct ? | 0 Yes | 1 No |
how to reverse string "Hello World" by using pointers only. Without any temp var
Do you know what is the purpose of 'extern' keyword in a function declaration?
what will be the result of the following program ? char *gxxx() { static char xxx[1024]; return xxx; } main() { char *g="string"; strcpy(gxxx(),g); g = gxxx(); strcpy(g,"oldstring"); printf("The string is : %s",gxxx()); } a) The string is : string b) The string is :Oldstring c) Run time error/Core dump d) Syntax error during compilation e) None of these
print pattern 1 1 33 33 555 555 77777777 555 555 33 33 1 1
what is the use of bitfields & where do we use them?
What is the general form of a C program?
What is sparse file?
What is the difference between constant pointer and pointer to a constant. Give examples.
Write the program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.
How to calculate sum
write a recursive program in'c'to find whether a given five digit number is a palindrome or not
What are comments and how do you insert it in a C program?