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);
}

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1648


What is the hardest programming language?

657


How do you generate random numbers in C?

640


How can you tell whether two strings are the same?

817


Describe the steps to insert data into a singly linked list.

612






Place the #include statement must be written in the program?

560


Explain how do you print only part of a string?

640


Write a program to reverse a given number in c?

585


Are the expressions * ptr ++ and ++ * ptr same?

655


Why C language is a procedural language?

608


Can you define which header file to include at compile time?

573


what is the structure pointer?

1634


Between macros and functions,which is better to use and why?

1561


explain what are pointers?

610


What is the advantage of an array over individual variables?

726