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

Determine if a number is a power of 2 at O(1).

2 Answers  


what is the basis for selection of arrays or pointers as data structure in a program

0 Answers   TCS,


wap to print "hello world" without using the main function.

22 Answers   TCS, Wipro,


WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE GIVEN VALUES

1 Answers  


how to make a scientific calculater ?

0 Answers  






Whats wrong with the following function char *string() { char *text[20]; strcpy(text,"Hello world"); return text; }

3 Answers   Qualcomm,


we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?

2 Answers  


please tell me the logic for this C program : INPUT (string):ABCD OUTPUT :BCDA CDAB DABC

2 Answers   Mphasis,


what is the output of the following program and explain the answer #include<stdio.h> exp() { main(5) } main(int a) { printf("%d",a); return; }

3 Answers   Satyam,


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  


Write a program in C for showing working of different logical operator in C. Your program should guide users with proper message/menu on the console.

3 Answers   HCL,


what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }

20 Answers   Infosys,






Categories