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

Why are algorithms important in c program?

0 Answers  


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

0 Answers  


Is c procedural or object oriented?

0 Answers  


What is the mean of function?

0 Answers  


Can include files be nested?

0 Answers  






what is ur strangth & weekness

0 Answers   Cognizant, LG Soft, NetEnrich,


How can I find the modification date and time of a file?

0 Answers  


Difference between fopen() and open()?

3 Answers   Aricent,


how can we use static and extern?and where can we use this?

3 Answers   Excel,


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

0 Answers   HCL,


main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??

19 Answers   EBS, Ramco, Sangwin, TCS,


what is the main use of c where it can use the c

2 Answers   Infosys,


Categories