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

int j =15,i; for (i=1; 1<5; ++i) {printf ("%d%d ",j,i); j = j-3; }

2 Answers  


main() { int i = 10; printf(" %d %d %d \n", ++i, i++, ++i); }

8 Answers   TCS, Vector,


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

5 Answers   TCS, Vimukti Technologies,


prog for 1st five prime numbers in 2^x - 1

0 Answers  


identify the in correct expression a.a=b=3=4; b.a=b=c=d=0; float a=int b=3.5; d.int a; float b; a=b=3.5;

8 Answers   TCS,






#include<stdio.h> main() { int a=1; int b=0; b=++a + ++a; printf("%d %d",a,b); }

7 Answers   Infosys,


plz let me know how to become a telecom protocol tester. thank you.

0 Answers  


How to avoid structure padding in C?

7 Answers   Tech Mahindra,


define c

6 Answers   TCS, HCL,


write a program that finds the factorial of a number using recursion?

13 Answers   Infosys, TATA,


What is meaning of "Void main" in C Language.

24 Answers   HCL, TCS, Ford, GU, IBIBS, JUW,


show how link list can be used to repersent the following polynomial i) 5x+2

0 Answers   CBSE,






Categories