What is the output for the following program
#include<stdio.h>
main()
{
char a[5][5],flag;
a[0][0]='A';
flag=((a==*a)&&(*a==a[0]));
printf("%d\n",flag);
}
Answers were Sorted based on User's Feedback
Answer / sri
output is 1 but this prg display 2 warning (ie) Nonportable
pointer comparsion
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / vignesh1988i
FLAG WILL give zero.....
because a refers to the 2D array's base address, *a refers to the value at the 0th row and 0th column.... so this address will not match the ascii value of the char 'A'.... so however it is logical AND so, the value is 0.........
thank u
| Is This Answer Correct ? | 4 Yes | 1 No |
the format specified for hexa decimal is a.%d b.%o c.%x d.%u
write a program for egyptian fractions in c?
When should you not use a type cast?
What is null pointer constant?
please send me the code for multiplying sparse matrix using c
Do you know what is the purpose of 'extern' keyword in a function declaration?
how to find a 5th bit is set in c program
Why is c platform dependent?
Can a pointer be static?
What is use of #include in c?
write a program to interchange the value between two variable without using loop
What are void pointers in c?