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



What is the output for the following program #include<stdio.h> main() {..

Answer / sri

output is 1 but this prg display 2 warning (ie) Nonportable
pointer comparsion

Is This Answer Correct ?    6 Yes 1 No

What is the output for the following program #include<stdio.h> main() {..

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

What is the output for the following program #include<stdio.h> main() {..

Answer / chanda_ni

1

Is This Answer Correct ?    4 Yes 2 No

What is the output for the following program #include<stdio.h> main() {..

Answer / jyothi

it gives syntax error

Is This Answer Correct ?    5 Yes 3 No

What is the output for the following program #include<stdio.h> main() {..

Answer / jaya prakash

0

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C Interview Questions

What are the 5 types of inheritance in c ++?

0 Answers  


What is the sizeof () operator?

0 Answers  


main() { int x=5,y=10,z=0; x=x++ + y++; y=y++ + ++x; z=x++ + ++y; printf("%d%d%d\n",x,y,z); }

1 Answers   CodeChef,


In a byte, what is the maximum decimal number that you can accommodate?

0 Answers  


Describe the difference between = and == symbols in c programming?

0 Answers  






Which is more efficient, a switch statement or an if else chain?

0 Answers  


What are the uses of pre-processor directives?

2 Answers  


output for following code??? main() { int x=2,y,z; x*=3+2; printf("1.%d\n",x); x*=y=z=4; printf("2.%d %d %d\n",x,y,z); x=y==z; printf("3.%d\n",x); x==(y=z); printf("%d",x); }

2 Answers   Elysium,


what is the use of operator ^ in C ? and how it works?

2 Answers  


What is difference between && and & in c?

0 Answers  


What is the difference between struct and typedef struct in c?

0 Answers  


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

0 Answers  


Categories