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 |
How can we see the Expanded source code and compiled code for our source program in C?
What is #include cctype?
Why does notstrcat(string, "!");Work?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
what is available in C language but not in C++?
10 Answers CTS, TCS,
What is the purpose of type declarations?
Which of the following about the C comments is incorrect ? a.commentscan go over multiple lines b.comments can start any where in the line c.a line can contain comments with out any language statements d.comments can occur within comments
How can I direct output to the printer?
Why do we use int main?
Here is a good puzzle: how do you write a program which produces its own source code as output?
How is null defined in c?
how to print this sereis 2 4 3 6 5..........?