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 |
wat is the meaning of c?
What is the role of this pointer?
write an algorithm to display a square matrix.
difference between i++* and *++i
Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV
Explain #pragma statements.
Why is main function so important?
what is the use of bitfields & where do we use them?
what will be the output of" printf("%d%d",scanf("%d% d",&a&b));"
What is difference between far and near pointers?
Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.
Difference between pass by reference and pass by value?