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

can we have joblib in a proc ?

1915


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

859


what is the syallabus of computer science students in group- 1?

2042


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

834


Define Array of pointers.

818


Where we use clrscr in c?

886


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

23054


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7754


What do you mean by command line argument?

813


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

900


What is this infamous null pointer, anyway?

782


Can we assign integer value to char in c?

812


What is the significance of scope resolution operator?

1106


Why doesnt this code work?

798


What are pointers? Why are they used?

830