main()
{
int a=0;
if(a=0) printf("Ramco Systems\n");
printf("India\n");
}
output?
Answers were Sorted based on User's Feedback
Answer / fazlur rahaman naik
actually the output will b : India only.
the above programme doesn't produce any error at if(a =
0).because we r assiging value here, we r not comparing the
value here.so the condition will fail here and the next
statement after if condition will print.
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / vikesh
the answer will be India
if statement executes the statement if it is true i.e other
than "0"..[eg.if(1)]
here we are giving a=0 which implies false.
so the if statement doesnot execute first statement.
if you dont agree check following
main()
{
int a=0;
if(a=1)/*other than zero any number*/
printf("Ramco Systems\n")
printf("India\n");}
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / ripal
The output will produce error because there is error at if
(a=0).It should be if(a==0)
| Is This Answer Correct ? | 8 Yes | 7 No |
Why array starts with index 0
f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?
How can I get back to the interactive keyboard if stdin is redirected?
What is pass by reference in c?
pierrot's divisor program using c or c++ code
a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
what is software?
What are the functions to open and close file in c language?
Is int a keyword in c?
Why is this loop always executing once?
what is the use of operator ^ in C ? and how it works?