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 is malloc() function?

0 Answers  


How many bytes is a struct in c?

0 Answers  


What is the difference between text and binary modes?

0 Answers  


Do pointers take up memory?

0 Answers  


int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why?

4 Answers   TCS,






program to print circle structure

1 Answers  


Disadvantages of C language.

0 Answers   Impetus,


wat is output of the following int main() { const int j=2; int i; switch(i) { case 1:break; case j:break; default:break; } }

2 Answers  


When should a type cast not be used?

0 Answers  


A program to write a number of letters and numbers, such as counting and display

0 Answers  


What is function prototype in c language?

0 Answers  


Explain union. What are its advantages?

0 Answers  


Categories