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 |
What is the value of y in the following code? x=7;y=0; if(x=6) y=7; else y=1;
Write c-code for 5+55+555+5555+55555+555555+5555555. Output will be it's answer...
Explain Linker and Loader
How can you tell whether a program was compiled using c versus c++?
how we can say java is platform independent, while we require JVM for that particular Operating System?
What does volatile do?
What's the best way to declare and define global variables?
What language is windows 1.0 written?
How the c program is executed?
What is difference between structure and union?
In c programming language, how many parameters can be passed to a function ?
What is openmp in c?